Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#311 Key stuck on in shell.

0.72
open
c2woody
shell (25)
5
2012-09-07
2008-07-09
Eric Fry
No

I'm running the game Ultima 6 and when I exit back to the shell the 'y' key gets stuck on.

To exit Ultima 6 you type Ctrl-q then it asks you if you want to quit. You then press 'y'

If I press the 'y' key normally it gets stuck on and the shell fills up with y characters until
I hit another key on the keyboard.

Here's the output of CheckEvent()

bad

key type SDL_KEYDOWN is key 3b [sym = 132, scancode = 0] Ctrl
key type SDL_KEYDOWN is key c [sym = 71, scancode = c] 'q'
key type SDL_KEYUP is key 3b [sym = 132, scancode = 0] Ctrl
key type SDL_KEYUP is key c [sym = 71, scancode = c] 'q'
key type SDL_KEYDOWN is key 10 [sym = 79, scancode = 10] 'y'
key type SDL_KEYUP is key 0 [sym = 79, scancode = 0] 'y' <--- It doesn't seem to match the keyup.

If I hit the 'y' key really quickly it works correctly and I get a blank shell prompt.

good

key type SDL_KEYDOWN is key 3b [sym = 132, scancode = 0] Ctrl
key type SDL_KEYDOWN is key c [sym = 71, scancode = c] 'q'
key type SDL_KEYUP is key 3b [sym = 132, scancode = 0] Ctrl
key type SDL_KEYUP is key c [sym = 71, scancode = c] 'q'
key type SDL_KEYDOWN is key 10 [sym = 79, scancode = 10] 'y'
key type SDL_KEYUP is key 10 [sym = 79, scancode = 10] 'y'

I'm running MACOSX with an Australian keyboard mapping (roman). I tried the standard US keyboard mapping and got the same result.

I found I could fix the problem by getting rid of the MACOSX code in GetKeyCode(). That's probably not a good solution though.

Regards,
Eric

Discussion