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

On Mac, the game doesn't properly detect the state of CMD key when pressed on startup #8896

Open
j-h-a opened this issue May 8, 2024 · 0 comments
Labels
bug Something is not working as expected engine Issues related to the Defold engine glfw input Issues related to user input

Comments

@j-h-a
Copy link

j-h-a commented May 8, 2024

Describe the bug (REQUIRED)

When you run your game from the editor with CMD+B with LSuper bound, the engine thinks the cmd key is held after it is released.

To Reproduce (REQUIRED)

  1. Download and open attached project, or follow the same steps in on_input called once per frame while key is held #8895 but use LSuper as the key and cmd as the action.
  2. Press and hold the left CMD key.
  3. Tap the B key to build and run the project.
  4. Keep CMD held and look at the console.
  5. Release CMD and see the problem demonstrated in the console.

Expected behavior (REQUIRED)

  • When you release CMD, you should get a single line of output indicating on_input is called once with action.released set to true.
  • You should never get an event delivered with action.pressed set to true.

Actual behavior

When the key is released on_input gets a pressed event and never gets a released event.

Note: Currently due to #8895 after getting the pressed event, you currently get another event delivered every frame after you release the key, this event has neither pressed, repeated, or released set to true. However that is a separate bug, the issue here is that you never get a released event.

Defold version (REQUIRED):

  • 1.8.0

Platforms (REQUIRED):

  • OS: macOS Sonoma 14.4.1
  • Device: Mac

Minimal repro case project (OPTIONAL):
cmd_bug.zip

Additional context (OPTIONAL):

Note: It is understood and expected that the pressed event should never be delivered, because the key was depressed before the app opened and therefore before the script acquired focus. The expectation is to get only one released event, but it would also be acceptable if the whole press/release cycle was dropped.

  • Expected: get the released event only (no pressed because it happened before focus)
  • Acceptable: get pressed event then released event
  • Acceptable: (no events delivered for key-presses initiated before focus)
  • Bug: get pressed event but never get released
@j-h-a j-h-a added the bug Something is not working as expected label May 8, 2024
@britzl britzl added input Issues related to user input engine Issues related to the Defold engine glfw labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected engine Issues related to the Defold engine glfw input Issues related to user input
Projects
None yet
Development

No branches or pull requests

2 participants