1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-12-03 07:28:51 -05:00
Related to #1528.
This commit is contained in:
Camilla Löwy 2019-07-11 19:06:06 +02:00
parent 36f90800d8
commit d232bcfcdd

View File

@ -1180,12 +1180,15 @@ static void processEvent(XEvent *event)
}
}
if (_glfw.x11.xkb.available && event->type == _glfw.x11.xkb.eventBase)
if (_glfw.x11.xkb.available)
{
if (((XkbEvent *)event)->any.xkb_type == XkbStateNotify &&
((XkbEvent *)event)->state.changed & XkbGroupStateMask)
if (event->type == _glfw.x11.xkb.eventBase + XkbEventCode)
{
_glfw.x11.xkb.group = ((XkbEvent *)event)->state.group;
if (((XkbEvent*) event)->any.xkb_type == XkbStateNotify &&
(((XkbEvent*) event)->state.changed & XkbGroupStateMask))
{
_glfw.x11.xkb.group = ((XkbEvent*) event)->state.group;
}
}
}
@ -2789,7 +2792,8 @@ const char* _glfwPlatformGetScancodeName(int scancode)
if (!_glfw.x11.xkb.available)
return NULL;
const KeySym keysym = XkbKeycodeToKeysym(_glfw.x11.display, scancode, _glfw.x11.xkb.group, 0);
const KeySym keysym = XkbKeycodeToKeysym(_glfw.x11.display,
scancode, _glfw.x11.xkb.group, 0);
if (keysym == NoSymbol)
return NULL;