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

The plus keycode is not working #308

Open
llsaull opened this issue Jul 9, 2024 · 0 comments
Open

The plus keycode is not working #308

llsaull opened this issue Jul 9, 2024 · 0 comments

Comments

@llsaull
Copy link

llsaull commented Jul 9, 2024

Hello everybody, thanks in advance for the attention.

I am having a problem reading the plus key. I have tried different keyboards and the problem persists.
I use the following code to check the pressing of a key:

checkKeyPressedEvent :: Event -> Keycode -> Bool
checkKeyPressedEvent event code = 
  case SDL.eventPayload event of
    SDL.KeyboardEvent kevent -> SDL.keyboardEventKeyMotion kevent == SDL.Pressed
        && SDL.keysymKeycode (SDL.keyboardEventKeysym kevent) == code
    _anyOtherEvent -> False

It works if I check for other keys, but It does not work for the plus key.

Looking at the definitions, I suspect that maybe it is related to the fact that the plus key does not have a scancode? It is just a guess though. Any help would be greatly appreciated.

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