1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Made key code translation table private to function.

This commit is contained in:
Camilla Berglund 2012-03-07 15:13:41 +01:00
parent 89eec8af09
commit 339fb7d246

View File

@ -136,11 +136,14 @@
//======================================================================== //========================================================================
// Keyboard symbol translation table // Converts a Mac OS X keycode to a GLFW keycode
//======================================================================== //========================================================================
static int convertMacKeyCode(unsigned int macKeyCode)
{
// Keyboard symbol translation table
// TODO: Need to find mappings for F13-F15, volume down/up/mute, and eject. // TODO: Need to find mappings for F13-F15, volume down/up/mute, and eject.
static const unsigned int MAC_TO_GLFW_KEYCODE_MAPPING[128] = static const unsigned int table[128] =
{ {
/* 00 */ GLFW_KEY_A, /* 00 */ GLFW_KEY_A,
/* 01 */ GLFW_KEY_S, /* 01 */ GLFW_KEY_S,
@ -272,20 +275,13 @@ static const unsigned int MAC_TO_GLFW_KEYCODE_MAPPING[128] =
/* 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];
} }