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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-09-16 11:03:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-17 06:20:50 +0300
commit6dca61b91c3178a22e8d6e9cdaaeaa12554ffb73 (patch)
treed43c0716d09b911738aa9df10bf4f31ede8944fa /source/blender/windowmanager/intern/wm_keymap.c
parent8bc27c508ae311111a6b436d4c90f8b131d98bc4 (diff)
Cleanup: remove KM_MOD_SECOND & KM_SHIFT2, KM_CTRL2.. etc
These were added in a1c8543f2acd7086d412cb794b32f96794b00659 (2007) but never used. Nor did they have any meaning in practice. Note that versioning keymap items isn't needed as these values were never set. The code-paths that set these values also set KM_MOD_FIRST causing `keymap_event_set` to only ever assign values of 0 or 1. These flags complicate further exposing KM_ANY (-1) which is also a valid value for modifiers.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index f1fe3e89007..bcd21fd7ac3 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -484,13 +484,10 @@ static void keymap_event_set(
kmi->shift = kmi->ctrl = kmi->alt = kmi->oskey = KM_ANY;
}
else {
- kmi->shift = (modifier & KM_SHIFT) ? KM_MOD_FIRST :
- ((modifier & KM_SHIFT2) ? KM_MOD_SECOND : false);
- kmi->ctrl = (modifier & KM_CTRL) ? KM_MOD_FIRST :
- ((modifier & KM_CTRL2) ? KM_MOD_SECOND : false);
- kmi->alt = (modifier & KM_ALT) ? KM_MOD_FIRST : ((modifier & KM_ALT2) ? KM_MOD_SECOND : false);
- kmi->oskey = (modifier & KM_OSKEY) ? KM_MOD_FIRST :
- ((modifier & KM_OSKEY2) ? KM_MOD_SECOND : false);
+ kmi->shift = (modifier & KM_SHIFT) ? KM_MOD_HELD : KM_NOTHING;
+ kmi->ctrl = (modifier & KM_CTRL) ? KM_MOD_HELD : KM_NOTHING;
+ kmi->alt = (modifier & KM_ALT) ? KM_MOD_HELD : KM_NOTHING;
+ kmi->oskey = (modifier & KM_OSKEY) ? KM_MOD_HELD : KM_NOTHING;
}
}
@@ -1164,7 +1161,6 @@ int WM_keymap_item_raw_to_string(const short shift,
buf[0] = '\0';
- /* TODO: support order (KM_SHIFT vs. KM_SHIFT2) ? */
if (shift == KM_ANY && ctrl == KM_ANY && alt == KM_ANY && oskey == KM_ANY) {
/* Don't show anything for any mapping. */
}