You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes a bug where key release events reported incorrect key codes when
multiple keys were pressed simultaneously. The original implementation
used a shared static KeyEvent variable that was overwritten by each key
press, causing releases to report the code of the last pressed key rather
than the key being released.
Removes the onCharInput callback and shared static variable, instead
calculating the KeyEvent directly from GLFW's parameters on both press
and release. This ensures each key event uses the correct code for that
specific key.
Note: This is a pragmatic fix for the immediate bug, but the underlying
architecture remains flawed. KeyEvent conflates two distinct concepts:
physical key events (for shortcuts, game input) and character input (for
text entry, Unicode). Issue #2337 highlights this confusion - users expect
KeyEvent codes to match shifted characters like '?', but codes should
represent physical keys.
The proper solution requires adding a separate keyChar() event type,
similar to Windows' WM_KEYDOWN/WM_KEYUP vs WM_CHAR separation. This
architectural change would affect all platforms and is beyond the scope
of this fix.
Fixes#2226
Related to #2337
0 commit comments