Cleanup: remove references to key-map modifier values denoting order
This feature was never exposed to users.
This commit is contained in:
parent
3c175caaa3
commit
ef431a8705
Notes:
blender-bot
2023-02-14 11:07:28 +01:00
Referenced by issue #95591, Crash on drawing with measure tool
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue