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 <campbell@blender.org>2022-09-17 16:54:23 +0300
committerCampbell Barton <campbell@blender.org>2022-09-17 17:39:13 +0300
commit44272fdd23e3b4d023d9dfa91401a33bcef427e7 (patch)
tree1a6527697c624f8280cce0c8a025b98df4eadd13
parentd74c16ba81145490ce6977572d9c5a5fd2adc7f8 (diff)
WM: send a modifier press when activating a window with modifier held
Previously the a simulated event was sent for releasing modifiers on activation but pressing only set the eventstate flag. Prefer the simulated events since press/release events are used in some modal key-maps.
-rw-r--r--source/blender/windowmanager/intern/wm_window.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 208b3dbc89d..9180c53aeb5 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1167,7 +1167,12 @@ static bool ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_pt
#ifdef USE_WIN_ACTIVATE
else {
if (keymodifier & g_modifier_table[i].flag) {
- win->eventstate->modifier |= g_modifier_table[i].flag;
+ for (int side = 0; side < 2; side++) {
+ if (keymodifier_sided[side] & g_modifier_table[i].flag) {
+ kdata.key = g_modifier_table[i].ghost_key_pair[side];
+ wm_event_add_ghostevent(wm, win, GHOST_kEventKeyDown, &kdata);
+ }
+ }
}
}
#endif