diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-03 05:56:05 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-03 05:57:44 +0300 |
commit | ef431a87057d366afe589a1c7b16e83809191ca6 (patch) | |
tree | e0c3e68c66987cbe99243fd1476a172c390cf77e /source/blender/windowmanager | |
parent | 3c175caaa34f721ec876c927d9049bfdce892a69 (diff) |
Cleanup: remove references to key-map modifier values denoting order
This feature was never exposed to users.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 36ac6f401b1..af7d2a26e7e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2037,33 +2037,28 @@ static bool wm_eventmatch(const wmEvent *winevent, const wmKeyMapItem *kmi) } } - const bool shift = (winevent->modifier & KM_SHIFT) != 0; - const bool ctrl = (winevent->modifier & KM_CTRL) != 0; - const bool alt = (winevent->modifier & KM_ALT) != 0; - const bool oskey = (winevent->modifier & KM_OSKEY) != 0; - - /* Modifiers also check bits, so it allows modifier order. - * Account for rare case of when these keys are used as the 'type' not as modifiers. */ + /* Account for rare case of when these keys are used as the 'type' not as modifiers. */ if (kmi->shift != KM_ANY) { - if ((shift != kmi->shift) && !(shift & kmi->shift) && - !ELEM(winevent->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) { + const bool shift = (winevent->modifier & KM_SHIFT) != 0; + if ((shift != kmi->shift) && !ELEM(winevent->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) { return false; } } if (kmi->ctrl != KM_ANY) { - if (ctrl != kmi->ctrl && !(ctrl & kmi->ctrl) && - !ELEM(winevent->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY)) { + const bool ctrl = (winevent->modifier & KM_CTRL) != 0; + if (ctrl != kmi->ctrl && !ELEM(winevent->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY)) { return false; } } if (kmi->alt != KM_ANY) { - if (alt != kmi->alt && !(alt & kmi->alt) && - !ELEM(winevent->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY)) { + const bool alt = (winevent->modifier & KM_ALT) != 0; + if (alt != kmi->alt && !ELEM(winevent->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY)) { return false; } } if (kmi->oskey != KM_ANY) { - if (oskey != kmi->oskey && !(oskey & kmi->oskey) && (winevent->type != EVT_OSKEY)) { + const bool oskey = (winevent->modifier & KM_OSKEY) != 0; + if ((oskey != kmi->oskey) && (winevent->type != EVT_OSKEY)) { return false; } } |