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:
parent
89eec8af09
commit
339fb7d246
|
@ -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.
|
||||
static const unsigned int MAC_TO_GLFW_KEYCODE_MAPPING[128] =
|
||||
static const unsigned int table[128] =
|
||||
{
|
||||
/* 00 */ GLFW_KEY_A,
|
||||
/* 01 */ GLFW_KEY_S,
|
||||
|
@ -272,20 +275,13 @@ static const unsigned int MAC_TO_GLFW_KEYCODE_MAPPING[128] =
|
|||
/* 7f */ -1,
|
||||
};
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Converts a Mac OS X keycode to a GLFW keycode
|
||||
//========================================================================
|
||||
|
||||
static int convertMacKeyCode(unsigned int macKeyCode)
|
||||
{
|
||||
if (macKeyCode >= 128)
|
||||
return -1;
|
||||
|
||||
// This treats keycodes as *positional*; that is, we'll return 'a'
|
||||
// for the key left of 's', even on an AZERTY keyboard. The charInput
|
||||
// function should still get 'q' though.
|
||||
return MAC_TO_GLFW_KEYCODE_MAPPING[macKeyCode];
|
||||
return table[macKeyCode];
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user