mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
Disabled modifier keys processing in UI by Cocoa backend
Modifier keys no longer trigger bound actions in menu/console/chat
This commit is contained in:
parent
8fce9d9d2d
commit
2eb51e5f79
1 changed files with 8 additions and 10 deletions
|
@ -588,6 +588,12 @@ void ProcessKeyboardEvent(NSEvent* theEvent)
|
|||
|
||||
void ProcessKeyboardFlagsEvent(NSEvent* theEvent)
|
||||
{
|
||||
if (GUICapture)
|
||||
{
|
||||
// Ignore events from modifier keys in menu/console/chat
|
||||
return;
|
||||
}
|
||||
|
||||
static const uint32_t FLAGS_MASK =
|
||||
NSDeviceIndependentModifierFlagsMask & ~NSNumericPadKeyMask;
|
||||
|
||||
|
@ -601,23 +607,15 @@ void ProcessKeyboardFlagsEvent(NSEvent* theEvent)
|
|||
}
|
||||
|
||||
event_t event = {};
|
||||
|
||||
event.type = modifiers > oldModifiers ? EV_KeyDown : EV_KeyUp;
|
||||
event.data1 = ModifierToDIK(deltaModifiers);
|
||||
|
||||
oldModifiers = modifiers;
|
||||
|
||||
// Caps Lock is a modifier key which generates one event per state change
|
||||
// but not per actual key press or release. So treat any event as key down
|
||||
// Also its event should be not be posted in menu and console
|
||||
|
||||
if (DIK_CAPITAL == event.data1)
|
||||
{
|
||||
if (GUICapture)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Caps Lock is a modifier key which generates one event per state change
|
||||
// but not per actual key press or release. So treat any event as key down
|
||||
event.type = EV_KeyDown;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue