From aaf65749e9df7349cdbffd2cce05717783dad1f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 15 Jun 2019 13:31:49 +1000 Subject: WM: Remove Cmd-LMB for RMB emulation for apple The default apple keymap now uses Cmd as Ctrl, so the key isn't free to emulate RMB. --- .../blender/windowmanager/intern/wm_event_system.c | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 005e05c4003..9ffa2be8293 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -4134,14 +4134,15 @@ static int convert_key(GHOST_TKey key) static void wm_eventemulation(wmEvent *event, bool test_only) { - /* Store last mmb/rmb event value to make emulation work when modifier keys - * are released first. This really should be in a data structure somewhere. */ + /* Store last middle-mouse event value to make emulation work + * when modifier keys are released first. + * This really should be in a data structure somewhere. */ static int emulating_event = EVENT_NONE; - /* middlemouse and rightmouse emulation */ + /* Middle-mouse emulation. */ if (U.flag & USER_TWOBUTTONMOUSE) { - if (event->type == LEFTMOUSE) { + if (event->type == LEFTMOUSE) { if (event->val == KM_PRESS && event->alt) { event->type = MIDDLEMOUSE; event->alt = 0; @@ -4150,26 +4151,12 @@ static void wm_eventemulation(wmEvent *event, bool test_only) emulating_event = MIDDLEMOUSE; } } -#ifdef __APPLE__ - else if (event->val == KM_PRESS && event->oskey) { - event->type = RIGHTMOUSE; - event->oskey = 0; - - if (!test_only) { - emulating_event = RIGHTMOUSE; - } - } -#endif else if (event->val == KM_RELEASE) { /* only send middle-mouse release if emulated */ if (emulating_event == MIDDLEMOUSE) { event->type = MIDDLEMOUSE; event->alt = 0; } - else if (emulating_event == RIGHTMOUSE) { - event->type = RIGHTMOUSE; - event->oskey = 0; - } if (!test_only) { emulating_event = EVENT_NONE; -- cgit v1.2.3