Not really sure if this has anything to do with your problem...
http://www.beyondlogic.org/keyboard/keybrd.htm
Looks to me like you you're on the right track...just not all the way there yet.
You've told the PC that you've pressed the 'q' key, but you haven't told the PC that you've released it, therefore, it repeats.
The first paragraph of the link above has some good info in it on the whole keyboard theory...should give you all the answers you need.
Bookmarks