mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
Cleanup
This commit is contained in:
+7
-7
@@ -232,8 +232,8 @@ static void createKeyTables(void)
|
||||
{
|
||||
int scancode, key;
|
||||
|
||||
memset(_glfw.x11.publicKeys, -1, sizeof(_glfw.x11.publicKeys));
|
||||
memset(_glfw.x11.nativeKeys, -1, sizeof(_glfw.x11.nativeKeys));
|
||||
memset(_glfw.x11.keycodes, -1, sizeof(_glfw.x11.keycodes));
|
||||
memset(_glfw.x11.scancodes, -1, sizeof(_glfw.x11.scancodes));
|
||||
|
||||
if (_glfw.x11.xkb.available)
|
||||
{
|
||||
@@ -305,7 +305,7 @@ static void createKeyTables(void)
|
||||
else key = GLFW_KEY_UNKNOWN;
|
||||
|
||||
if ((scancode >= 0) && (scancode < 256))
|
||||
_glfw.x11.publicKeys[scancode] = key;
|
||||
_glfw.x11.keycodes[scancode] = key;
|
||||
}
|
||||
|
||||
XkbFreeNames(desc, XkbKeyNamesMask, True);
|
||||
@@ -316,12 +316,12 @@ static void createKeyTables(void)
|
||||
{
|
||||
// Translate the un-translated key codes using traditional X11 KeySym
|
||||
// lookups
|
||||
if (_glfw.x11.publicKeys[scancode] < 0)
|
||||
_glfw.x11.publicKeys[scancode] = translateKeyCode(scancode);
|
||||
if (_glfw.x11.keycodes[scancode] < 0)
|
||||
_glfw.x11.keycodes[scancode] = translateKeyCode(scancode);
|
||||
|
||||
// Store the reverse translation for faster key name lookup
|
||||
if (_glfw.x11.publicKeys[scancode] > 0)
|
||||
_glfw.x11.nativeKeys[_glfw.x11.publicKeys[scancode]] = scancode;
|
||||
if (_glfw.x11.keycodes[scancode] > 0)
|
||||
_glfw.x11.scancodes[_glfw.x11.keycodes[scancode]] = scancode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user