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

love.keyboard.isDown does not properly detect remapped input #2082

Open
underscoreevelyn opened this issue Jun 24, 2024 · 1 comment
Open
Labels
library dependency Related to a library used by LÖVE Linux more info needed Further information is needed from the user

Comments

@underscoreevelyn
Copy link

Using certain xkb keyboard options confuses love.keyboard.isDown. With +ctrl(nocaps) and the following code,

function love.keypressed(key, scancode, repeating)
  print("pressed", key, scancode, repeating)
  print("is down", love.keyboard.isDown(key))
end

Pressing left control produces

pressed lctrl lctrl false
is down false

and pressing capslock produces

pressed lctrl capslock false
is down true

This behavior is confusing, at least to me. Considering the key parameter passed to keypressed is lctrl in both cases, I would expect isDown to return true if either virtual control key was pressed. At the very least, it should default to the state of the physical control key and not the capslock key. It's possible this is an issue in SDL, but I've never had this issue in an SDL application and I don't have the experience to check for sure.

@slime73
Copy link
Member

slime73 commented Jun 24, 2024

It's possible this is an issue in SDL

It'd be SDL (possibly including the system's configuration of SDL) or at a lower level than SDL, I think.

Considering the key parameter passed to keypressed is lctrl in both cases, I would expect isDown to return true if either virtual control key was pressed.

I know capslock is pretty finnicky when trying to detect actual presses rather than caps state on lots of different platforms, I dunno if that applies here though.

Are you getting keyreleased events immediately after keypressed in your first example, maybe?

@slime73 slime73 added library dependency Related to a library used by LÖVE Linux labels Jun 24, 2024
@slime73 slime73 added the more info needed Further information is needed from the user label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library dependency Related to a library used by LÖVE Linux more info needed Further information is needed from the user
Projects
None yet
Development

No branches or pull requests

2 participants