The Random House Dictionary of the English Language, has this definition:

Tom Swiftie, a play on words that follows an unvarying pattern and relies for its humor on a punning relationship between the way an adverb describes a speaker and at the same time refers significantly to the import of the speaker's statement, as in "I know who turned off the lights," Tom hinted darkly.

A correspondent writes that "the Tom Swifty is really Tom Swiftly, as in 'said Tom Swiftly.'" The writer was Jim Wegryn, who has the Tom Swiftlies page. "The adverbial
'ly' is the key. Calling them Swifties makes no sense. Your example, 'Tom hinted darkly' would
have to be 'Tom hinted darky.'"