|
|
|
@ -617,18 +617,25 @@ static int translateKey(unsigned int key) |
|
|
|
|
- (void)flagsChanged:(NSEvent *)event |
|
|
|
|
{ |
|
|
|
|
int action; |
|
|
|
|
unsigned int newModifierFlags = |
|
|
|
|
const unsigned int modifierFlags = |
|
|
|
|
[event modifierFlags] & NSDeviceIndependentModifierFlagsMask; |
|
|
|
|
const int key = translateKey([event keyCode]); |
|
|
|
|
const int mods = translateFlags(modifierFlags); |
|
|
|
|
|
|
|
|
|
if (newModifierFlags > window->ns.modifierFlags) |
|
|
|
|
if (modifierFlags == window->ns.modifierFlags) |
|
|
|
|
{ |
|
|
|
|
if (window->key[key] == GLFW_PRESS) |
|
|
|
|
action = GLFW_RELEASE; |
|
|
|
|
else |
|
|
|
|
action = GLFW_PRESS; |
|
|
|
|
} |
|
|
|
|
else if (modifierFlags > window->ns.modifierFlags) |
|
|
|
|
action = GLFW_PRESS; |
|
|
|
|
else |
|
|
|
|
action = GLFW_RELEASE; |
|
|
|
|
|
|
|
|
|
window->ns.modifierFlags = newModifierFlags; |
|
|
|
|
window->ns.modifierFlags = modifierFlags; |
|
|
|
|
|
|
|
|
|
const int key = translateKey([event keyCode]); |
|
|
|
|
const int mods = translateFlags([event modifierFlags]); |
|
|
|
|
_glfwInputKey(window, key, [event keyCode], action, mods); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|