mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 21:30:57 +00:00
Fix #1112: simultaneous key presses being dropped
This improves the mechanism to check for duplicate key press events, by checking if the event with the same time code actually corresponds to the same key. This will correctly process any key known to GLFW, handling simultanous presses of different keys, while still filtering out duplicate presses of the same key. Note that this still does not properly handle keys that are GLFW_KEY_UNKNOWN, as I am not aware of a good way to check for previous events on those keys.
This commit is contained in:
parent
599fb3de34
commit
4ea7ed07ff
@ -118,7 +118,7 @@ information on what to include when reporting a bug.
|
||||
|
||||
## Changelog
|
||||
|
||||
User-visible changes since the last release.
|
||||
- [X11] Bugfix: Simultanous key presses were being ignored (#1112)
|
||||
|
||||
|
||||
## Contact
|
||||
|
@ -1258,7 +1258,8 @@ static void processEvent(XEvent *event)
|
||||
// These have the same timestamp as the original event
|
||||
// Corresponding release events are filtered out
|
||||
// implicitly by the GLFW key repeat logic
|
||||
if (window->x11.lastKeyTime < event->xkey.time)
|
||||
if (window->x11.lastKeyTime < event->xkey.time ||
|
||||
(key != GLFW_KEY_UNKNOWN && window->keys[key] != GLFW_PRESS))
|
||||
{
|
||||
if (keycode)
|
||||
_glfwInputKey(window, key, keycode, GLFW_PRESS, mods);
|
||||
|
Loading…
Reference in New Issue
Block a user