Score:2

How can a single keystroke create 2 KeyPress events?

ar flag

For no apparent reason, some keys on my keyboard started behaving strange. Most notably on the numpad I would get 2 numbers or a number and a sign with a single keystroke. Used command xev on the terminal and saw that some keys had 2 events for a single keystroke.

Here is an example of the results I got pressing key '9' on numpad.

KeyPress event, serial 37, synthetic NO, window 0x2800001,
    root 0x789, subw 0x0, time 8174693, (1195,543), root:(1245,662),
    state 0x10, keycode 114 (keysym 0xff53, Right), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2800001,
    root 0x789, subw 0x0, time 8174694, (1195,543), root:(1245,662),
    state 0x10, keycode 81 (keysym 0xffb9, KP_9), same_screen YES,
    XLookupString gives 1 bytes: (39) "9"
    XmbLookupString gives 1 bytes: (39) "9"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2800001,
    root 0x789, subw 0x0, time 8174912, (1195,543), root:(1245,662),
    state 0x10, keycode 114 (keysym 0xff53, Right), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2800001,
    root 0x789, subw 0x0, time 8174923, (1195,543), root:(1245,662),
    state 0x10, keycode 81 (keysym 0xffb9, KP_9), same_screen YES,
    XLookupString gives 1 bytes: (39) "9"
    XFilterEvent returns: False

Also, during the day the combination of events would change. I couldn't see a pattern, but it was mostly the numpad, arrow and special characters keys that had this problem. I made no updates/upgrades prior to this.

I have a X11 driver, and tried reinstalling it, with no luck. I also don't think it is a hardware problem. How do I solve this? Or at least, what should my next step be?

Any help will be appreciated!

David avatar
cn flag
Have you tried a different keyboard? Have you booted from a live media and seen if it does it there as well?
ar flag
@David Different keyboard, yes. Same problem but on different keys. Hadn't thought of live media. Will try now.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.