mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-27 04:28:52 -05:00
Made key code translation table private to function.
This commit is contained in:
parent
89eec8af09
commit
339fb7d246
|
@ -136,12 +136,15 @@
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// Keyboard symbol translation table
|
// Converts a Mac OS X keycode to a GLFW keycode
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
// TODO: Need to find mappings for F13-F15, volume down/up/mute, and eject.
|
static int convertMacKeyCode(unsigned int macKeyCode)
|
||||||
static const unsigned int MAC_TO_GLFW_KEYCODE_MAPPING[128] =
|
|
||||||
{
|
{
|
||||||
|
// Keyboard symbol translation table
|
||||||
|
// TODO: Need to find mappings for F13-F15, volume down/up/mute, and eject.
|
||||||
|
static const unsigned int table[128] =
|
||||||
|
{
|
||||||
/* 00 */ GLFW_KEY_A,
|
/* 00 */ GLFW_KEY_A,
|
||||||
/* 01 */ GLFW_KEY_S,
|
/* 01 */ GLFW_KEY_S,
|
||||||
/* 02 */ GLFW_KEY_D,
|
/* 02 */ GLFW_KEY_D,
|
||||||
|
@ -270,22 +273,15 @@ static const unsigned int MAC_TO_GLFW_KEYCODE_MAPPING[128] =
|
||||||
/* 7d */ GLFW_KEY_DOWN,
|
/* 7d */ GLFW_KEY_DOWN,
|
||||||
/* 7e */ GLFW_KEY_UP,
|
/* 7e */ GLFW_KEY_UP,
|
||||||
/* 7f */ -1,
|
/* 7f */ -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// Converts a Mac OS X keycode to a GLFW keycode
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
static int convertMacKeyCode(unsigned int macKeyCode)
|
|
||||||
{
|
|
||||||
if (macKeyCode >= 128)
|
if (macKeyCode >= 128)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// This treats keycodes as *positional*; that is, we'll return 'a'
|
// This treats keycodes as *positional*; that is, we'll return 'a'
|
||||||
// for the key left of 's', even on an AZERTY keyboard. The charInput
|
// for the key left of 's', even on an AZERTY keyboard. The charInput
|
||||||
// function should still get 'q' though.
|
// function should still get 'q' though.
|
||||||
return MAC_TO_GLFW_KEYCODE_MAPPING[macKeyCode];
|
return table[macKeyCode];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user