I recently decided to try Emacs. One of the things I found extremely frustrating about the software was that most of the time when I held down the spacebar, I would only get one space character inserted, and a message saying
<Hangul> is undefined
in the echo area. Pressing space once worked fine, and I could achieve multiple space characters by repeatedly pressing the spacebar, but holding down the spacebar did not work as expected. I went to Google to troubleshoot, but aside from this thread I couldn't find much information about it. I did luck onto the solution that hitting numlock seemed to fix the issue, however I needed to do that every time I opened Emacs (and perhaps every time I opened a new buffer -- I didn't play around with it too much.)
I opened up xev, and found that holding down the spacebar mostly produced space characters, as expected, however there were time it produced Hangul. Here is some sample output
KeyPress event, serial 34, synthetic NO, window 0x2800001,
root 0x6c4, subw 0x0, time 2848166447, (-197,490), root:(767,510),
state 0x0, keycode 65 (keysym 0x20, space), same_screen YES,
XLookupString gives 1 bytes: (20) " "
XmbLookupString gives 1 bytes: (20) " "
XFilterEvent returns: False
KeyPress event, serial 34, synthetic NO, window 0x2800001,
root 0x6c4, subw 0x0, time 2848166463, (-197,490), root:(767,510),
state 0x0, keycode 130 (keysym 0xff31, Hangul), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x2800001,
root 0x6c4, subw 0x0, time 2848166511, (-197,490), root:(767,510),
state 0x0, keycode 130 (keysym 0xff31, Hangul), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x2800001,
root 0x6c4, subw 0x0, time 2848166567, (-197,490), root:(767,510),
state 0x0, keycode 65 (keysym 0x20, space), same_screen YES,
XLookupString gives 1 bytes: (20) " "
XFilterEvent returns: False
It was hard to reproduce this error, and I could not tell anything that I was doing differently when it happened, however whenever I did see that error it seemed to follow this Keypress Keypress Keyrelease Keyrelease pattern.
I used the command xkbcomp $DISPLAY my_keymap.xkb
, and I've uploaded the file to github in case it is helpful. Hangul is defined there, but I still don't understand how it's being triggered.
Some additional information that I think might be helpful:
I am using a qwerty keyboard
I am using Linux Mint 19.2
Though apparently this is a system wide problem, since it's being detected by xev, I have not noticed this cause any weird behavior in applications that I am running with the exception of Emacs. If I had not run Emacs, I would probably not know about this.
The output of
setxkbmap -query
isrules: evdev model: pc105 layout: us
Any help resolving this would be appreciated.
showkey
in the virtual console and report back if two different keycodes are returned for each space bar press.