mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Merge pull request #8437 from DSkywalk/master
X11 auto-repeat event fixed
This commit is contained in:
commit
75102a435f
@ -570,8 +570,22 @@ bool x11_alive(void *data)
|
||||
case ButtonRelease:
|
||||
break;
|
||||
|
||||
case KeyPress:
|
||||
case KeyRelease:
|
||||
/* When you receive a key release and the next event is a key press
|
||||
of the same key combination, then it's auto-repeat and the
|
||||
key wasn't actually released. */
|
||||
if(XEventsQueued(g_x11_dpy, QueuedAfterReading))
|
||||
{
|
||||
XEvent next_event;
|
||||
XPeekEvent(g_x11_dpy, &next_event);
|
||||
if (next_event.type == KeyPress &&
|
||||
next_event.xkey.time == event.xkey.time &&
|
||||
next_event.xkey.keycode == event.xkey.keycode)
|
||||
{
|
||||
break; // Key wasn't actually released
|
||||
}
|
||||
}
|
||||
case KeyPress:
|
||||
if (event.xkey.window == g_x11_win)
|
||||
x11_handle_key_event(keycode, &event, g_x11_xic, filter);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user