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

Using Super + "Key" on macOS results in "Key" not being released #4

Closed
ypujante opened this issue Jun 23, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@ypujante
Copy link
Member

Steps to reproduce:

  • go to the live demo
  • Press Super (or Meta)
  • While Super is being held, press "A"
  • Note that glfwGetKey (second table) shows: A:P|Q:R|Z:R
  • Release "A"
  • Note that glfwGetKey (second table) shows: A:P|Q:R|Z:R

Expected result
It should show A:R|Q:R|Z:R

Note that the embedded glfw3 implementation shows the same issue

@ypujante ypujante added the bug Something isn't working label Jun 23, 2024
ypujante added a commit that referenced this issue Jun 25, 2024
- The workaround implemented, releases all keys when "Super" is released. Although not a perfect
  solution, it guarantees that the state is eventually consistent
@ypujante
Copy link
Member Author

There is a workaround implemented for this issue. See release notes.

sbc100 pushed a commit to emscripten-core/emscripten that referenced this issue Jun 25, 2024
I released a new version of contrib.glfw3 with a workaround/bug fix. I
wanted to point out that there is the same issue that was
[created](#18089) on
10/22 for the built-in implementation. That was never addressed. I also
wanted to point out that SDL2 also suffers from the same issue...

I found [this issue](ocornut/imgui#7732) while
working on a project using ImGui.


![Meta_V](https://github.com/ocornut/imgui/assets/357116/0cec5893-d146-40fe-ae15-2fd00e7bd319)

Release notes:
- Implemented workaround for
[#4](pongasoft/emscripten-glfw#4): _Using
Super + "Key" on macOS results in "Key" not being released_.
Due to the [broken
state](https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser)
of javascript handling the `Super/Meta` key, there is no good solution.
The workaround implemented, releases all keys when `Super` is released.
Although not a perfect solution, it guarantees that the state is
_eventually_ consistent:
- if "Key" was released while "Super" was held, then when "Super" gets
released, "Key" is released (later than when actually released, final
state is consistent: "Key" in `Release` state)
- if "Key" is still held when "Super" is released, "Key" is released
when "Super" gets released, but immediately gets a down event (Up/Down
event, final state is consistent": "Key" in `Pressed` state)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant