| Summary: | SDL not recognizing 'space' on some keyboards | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Drew Bliss <drewb> |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus, magist3r, me, ori, sezeroz |
| Version: | 2.0.3 | Keywords: | target-2.0.6 |
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
xev on us layout
xev on ru layout |
||
|
Description
Drew Bliss
2015-10-15 20:03:32 UTC
I can't reproduce this here, but I can't help but think either this broke it...
https://hg.libsdl.org/SDL/rev/8a89b58895c1
...or this is an Arch-specific bug?
Specifically, it looks like the failure is here...
https://hg.libsdl.org/SDL/file/c31b24c7babc/src/video/x11/SDL_x11keyboard.c#l329
...which lands here...
https://hg.libsdl.org/SDL/file/c31b24c7babc/src/video/x11/SDL_x11keyboard.c#l182
...which presumably returns NoSymbol. The fallback once this happens...
https://hg.libsdl.org/SDL/file/c31b24c7babc/src/video/x11/SDL_x11keyboard.c#l333
...only works on US QWERTY keyboards, so we end up with that SDLK_SCANCODE_MASK | SDL_SCANCODE_UNKNOWN in that switch statement's default case.
I've updated the table in X11_KeySymToUcs4(), but presumably we never got this far, and it looks like it was right except for a small unrelated thing. We'd have to deep-dive on this person's computer (including the keyboard he's using) to get further now, I think. I'll ask him to run xev.
--ryan.
Created attachment 2394 [details]
xev on us layout
Created attachment 2395 [details]
xev on ru layout
I've added logs from xev. I pressed button '1' after starting command with en and ru locales. In Dota2 it recognizes sometimes as RETURN. I've got the same issue on one of my laptops. Do you guys need any more info? I *think* I'm affected by this, but not sure. Willing to perform any tests you wish. I have a keyboard that's usually set to US English, but I also use a Hebrew layout. The first game where I 'space' didn't work is Thimbleweed Park. 'space' is supposed to pause the game, but instead did nothing. It was magically fixed after a while, likely tied to an update, but I'm not sure. They never updated their SDL version (2.0.5), and made no discernible changes to the UI code. The game Opus Magnum was just released, using SDL 2.*. It makes two uses of the space key: as a hotkey to activate an action, which doesn't work for me, and for inputting arbitrary text, which does work. Follow-up to my previous comment: Opus Magnum ships with SDL 2.0.4, and if I link it against 2.0.5 onwards, the space key is recognized correctly. I tried bisecting the code to find the fix, and I think it's this one: changeset: 10439:0426a82e291d user: Sam Lantinga <slouken@libsdl.org> date: Sat Oct 01 14:22:10 2016 -0700 summary: Fixed bug 3130 - Spacebar not responding Great, thanks! Is this really fixed now? If so, by which commit? (In reply to Ozkan Sezer from comment #9) > Is this really fixed now? If so, by which commit? As mentioned above, my testing implies it's this one: https://hg.libsdl.org/SDL/rev/0426a82e291d Some of the commits around it failed to compile, but this is the first one where the space key worked on my test program. OK, I see; I misinterpreted your comment in a way that that commit started your issue. Sorry for the noise. |