mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +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)
|
void ProcessKeyboardFlagsEvent(NSEvent* theEvent)
|
||||||
{
|
{
|
||||||
|
if (GUICapture)
|
||||||
|
{
|
||||||
|
// Ignore events from modifier keys in menu/console/chat
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static const uint32_t FLAGS_MASK =
|
static const uint32_t FLAGS_MASK =
|
||||||
NSDeviceIndependentModifierFlagsMask & ~NSNumericPadKeyMask;
|
NSDeviceIndependentModifierFlagsMask & ~NSNumericPadKeyMask;
|
||||||
|
|
||||||
|
@ -601,23 +607,15 @@ void ProcessKeyboardFlagsEvent(NSEvent* theEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
event_t event = {};
|
event_t event = {};
|
||||||
|
|
||||||
event.type = modifiers > oldModifiers ? EV_KeyDown : EV_KeyUp;
|
event.type = modifiers > oldModifiers ? EV_KeyDown : EV_KeyUp;
|
||||||
event.data1 = ModifierToDIK(deltaModifiers);
|
event.data1 = ModifierToDIK(deltaModifiers);
|
||||||
|
|
||||||
oldModifiers = modifiers;
|
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 (DIK_CAPITAL == event.data1)
|
||||||
{
|
{
|
||||||
if (GUICapture)
|
// 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
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.type = EV_KeyDown;
|
event.type = EV_KeyDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue