mirror of
https://github.com/glfw/glfw.git
synced 2024-12-02 06:47:10 +00: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.
|
// 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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user