Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading key presses not working when CTRL key is held down #187

Closed
soruk42 opened this issue May 30, 2022 · 1 comment
Closed

Reading key presses not working when CTRL key is held down #187

soruk42 opened this issue May 30, 2022 · 1 comment

Comments

@soruk42
Copy link

soruk42 commented May 30, 2022

My use case is the Matrix Brandy BASIC interpreter, which uses SDL 1.2 (I have a plan to port it, though not sure yet how to deal with the way it writes pixels directly to the framebuffer...). So far most is working, but keypresses involving the CTRL key are not picked up. This is easily demonstrated within Matrix Brandy, by issuing
PRINT GET
and pressing CTRL and any key, you should get that sequence ASCII code back, e.g. CTRL-Q should give 17. When run against the real SDL-1.2.15 this works perfectly, but against sdl12-compat no keypress is seen.

@soruk42
Copy link
Author

soruk42 commented Jul 13, 2022

I've run some comparisons between SDL-1.2.15 and the latest sdl12-compat from github, and it appears when the CTRL key is pressed they keysym.unicode struct member isn't completed.
SDL-1.2.15
'd'
keysym.unicode=100 keysym.sym=100 keysym.mod=0x0
SHIFT+'d'
keysym.unicode=68 keysym.sym=100 keysym.mod=0x1
CTRL+'d'
keysym.unicode=4 keysym.sym=100 keysym.mod=0x40
ALT+'d'
keysym.unicode=100 keysym.sym=100 keysym.mod=0x100

sdl12-compat:
'd'
keysym.unicode=100 keysym.sym=100 keysym.mod=0x0
SHIFT+'d'
keysym.unicode=68 keysym.sym=100 keysym.mod=0x1
CTRL+'d'
keysym.unicode=0 keysym.sym=100 keysym.mod=0x40
ALT+'d'
keysym.unicode=100 keysym.sym=100 keysym.mod=0x100

akb825 added a commit to akb825/sdl12-compat that referenced this issue Jul 28, 2022
Text events aren't sent when CTRL is pressed, causing applications that
depend on it to ignore some keyboard commands.

fixes libsdl-org#187
akb825 added a commit to akb825/sdl12-compat that referenced this issue Jul 28, 2022
Text events aren't sent when CTRL is pressed, causing applications that
depend on it to ignore some keyboard commands.

fixes libsdl-org#187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant