Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-03 05:56:05 +0300
committerCampbell Barton <campbell@blender.org>2022-03-03 05:57:44 +0300
commitef431a87057d366afe589a1c7b16e83809191ca6 (patch)
treee0c3e68c66987cbe99243fd1476a172c390cf77e /source
parent3c175caaa34f721ec876c927d9049bfdce892a69 (diff)
Cleanup: remove references to key-map modifier values denoting order
This feature was never exposed to users.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c23
2 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index dabef04583b..7a972ac3ef8 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -364,7 +364,7 @@ typedef struct wmKeyMapItem {
int8_t val;
/** Use when `val == WM_CLICK_DRAG`, */
int8_t direction;
- /** `oskey` also known as apple, windows-key or super, value denotes order of pressed. */
+ /** `oskey` also known as apple, windows-key or super. */
short shift, ctrl, alt, oskey;
/** Raw-key modifier. */
short keymodifier;
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;
}
}