mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Fixed modifier key events being lost.
This commit is contained in:
parent
20b7ac0518
commit
7123bcfc3e
@ -73,6 +73,8 @@ The following dependencies are needed by the examples and test programs:
|
|||||||
- [Cocoa] Bugfix: One copy of each display name string was leaked
|
- [Cocoa] Bugfix: One copy of each display name string was leaked
|
||||||
- [Cocoa] Bugfix: Monitor enumeration caused a segfault if no `NSScreen` was
|
- [Cocoa] Bugfix: Monitor enumeration caused a segfault if no `NSScreen` was
|
||||||
found for a given `CGDisplay`
|
found for a given `CGDisplay`
|
||||||
|
- [Cocoa] Bugfix: Modifier key events were lost if the corresponding modifier
|
||||||
|
bit field was unchanged
|
||||||
- [Win32] Enabled generation of pkg-config file for MinGW
|
- [Win32] Enabled generation of pkg-config file for MinGW
|
||||||
- [Win32] Bugfix: Failure to load winmm or its functions was not reported to
|
- [Win32] Bugfix: Failure to load winmm or its functions was not reported to
|
||||||
the error callback
|
the error callback
|
||||||
|
@ -617,18 +617,25 @@ static int translateKey(unsigned int key)
|
|||||||
- (void)flagsChanged:(NSEvent *)event
|
- (void)flagsChanged:(NSEvent *)event
|
||||||
{
|
{
|
||||||
int action;
|
int action;
|
||||||
unsigned int newModifierFlags =
|
const unsigned int modifierFlags =
|
||||||
[event modifierFlags] & NSDeviceIndependentModifierFlagsMask;
|
[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;
|
action = GLFW_PRESS;
|
||||||
else
|
else
|
||||||
action = GLFW_RELEASE;
|
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);
|
_glfwInputKey(window, key, [event keyCode], action, mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user