emscripten-core / emscripten-core/emscripten
library_glfw.js: GLFW_RELEASE not sent for keys after cmd/meta/menu key is pressed on mac
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
**Version of emscripten/emsdk:**
3.1.15
I'm using glfw (via Dear ImGui) and if I press cmd+c and let go of the c and then the cmd, I never receive the GLFW_RELEASE event.
I added the following print to library_glfw.js
```
onKeyup: function(event) {
console.log("onKeyChanged keyup: " + event.keyCode + "\n");
GLFW.onKeyChanged(event.keyCode, 0); // GLFW_RELEASE
},
```
That informed me the onKeyUp never gets fired. Searching around on the net, I see some discussion in other forms such as (https://github.com/electron/electron/issues/5188, https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser) which indicate that the Javascript onKeyup never gets called in cases where the browser takes over (such as the cmd+c/v/etc cases on mac).
I'm not familiar enough with the web platform to know if that's a browser bug or not. I imagine it's probably underspecified by the standard. Most everyone has accepted it's just the way it is and deal with it.
However, filing this bug to ask: should users of GLFW on emscripten be expected to deal with it? Presumably GLFW is supposed to abstract the underlying platform and thus should mitigate this somehow?
Contributor guide
Assessment
This issue has not been assessed yet.