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.
This commit is contained in:
Campbell Barton 2019-06-15 13:31:49 +10:00
parent 0fd96b4128
commit aaf65749e9
Notes: blender-bot 2023-02-14 11:20:29 +01:00
Referenced by issue #67233, Right click select, not working with 'Emulate 3 button Mouse'
Referenced by issue #65844, eevee renders wrong colors for hair if a vertex color is used as input
1 changed files with 5 additions and 18 deletions

View File

@ -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;