Page MenuHome

Remove/Update "Emulate Middle Mouse" preference
Confirmed, NormalPublicDESIGN

Description

This task is to check if it is reasonable to remove the emulate middle mouse option.

Blender 2.7x didn't allow left-click-select and emulate middle mouse to be enabled at once, this never worked - it's just that in 2.8x we allow both options to be enabled at once with key-conflicts.

Since I don't use a touch-pad on macOS / ms-windows, I'm not sure how common it is that middle-click gestures are enabled without having to manually configure it.

Are there systems where using a middle-click still isn't practical?

Options could be:

  • Remove this preference.
  • Remove the keys that use Alt-LMB (means re-working the keymap in some places).
  • Use an alternative shortcut that doesn't conflict, eg: OSKey (Cmd / Super / Windows-Key).

    (By default this conflicts on Linux with many window-managers, these would need to be re-configured not to use Super-LMB).

Unless this is given some attention it's likely Alt-LMB will be used more, to the point Emulate-Middle-Mouse preference isn't useful and we'll need to remove or document all it's known limitations and accept Blender isn't fully usable with this enabled.


There are currently conflicts using with emulate middle mouse

  • Number Button Alt-Drag to change all other selected items T69053: Emulate 3 Buttons doesn't work with ALT Modifier key on UI buttons
  • Edit-Mesh: Edge-ring de-select isn't possible.
  • Alt-MMB-drag to change views.
  • Grease Pencil, Circle Primitive
  • Weight Paint Gradient
  • Loop select (Worked around with double-click, but not very convenient since selecting boundaries requires quad-click).

Here is a full list of potential conflicts in the default keymap.

Are we serious about resolving these or would it be better to drop this option?


From a search of the code:

cat release/scripts/presets/keyconfig/keymap_data/blender_default.py | \
    pcregrep "('LEFTMOUSE'|params.select_mouse|params.action_tweak|params.action_mouse).*alt\":"
("uv.select_loop", {"type": params.select_mouse, "value": params.select_mouse_value, "alt": True},
("uv.select_loop", {"type": params.select_mouse, "value": params.select_mouse_value, "shift": True, "alt": True},
("uv.select_loop", {"type": params.select_mouse, "value": 'DOUBLE_CLICK', "alt": True},
("mask.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True},
("mask.select_lasso", {"type": params.action_tweak, "value": 'ANY', "shift": True, "ctrl": True, "alt": True},
("graph.clickselect", {"type": params.select_mouse, "value": 'PRESS', "alt": True},
("graph.clickselect", {"type": params.select_mouse, "value": 'PRESS', "shift": True, "alt": True},
("graph.clickselect", {"type": params.select_mouse, "value": 'PRESS', "ctrl": True, "alt": True},
("graph.clickselect", {"type": params.select_mouse, "value": 'PRESS', "shift": True, "ctrl": True, "alt": True},
("node.backimage_sample", {"type": params.action_mouse, "value": 'PRESS', "alt": True}, None),
("node.move_detach_links_release", {"type": params.action_tweak, "value": 'ANY', "alt": True}, None),
("action.clickselect", {"type": params.select_mouse, "value": 'PRESS', "alt": True},
("action.clickselect", {"type": params.select_mouse, "value": 'PRESS', "shift": True, "alt": True},
("action.clickselect", {"type": params.select_mouse, "value": 'PRESS', "ctrl": True, "alt": True},
("action.clickselect", {"type": params.select_mouse, "value": 'PRESS', "shift": True, "ctrl": True, "alt": True},
("sequencer.select", {"type": params.select_mouse, "value": 'PRESS', "alt": True},
("sequencer.select", {"type": params.select_mouse, "value": 'PRESS', "shift": True, "alt": True},
("clip.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True},
("clip.select_lasso", {"type": params.action_tweak, "value": 'ANY', "shift": True, "ctrl": True, "alt": True},
("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True, "key_modifier": 'D'},
("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "alt": True, "key_modifier": 'D'},
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True},
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "shift": True, "ctrl": True, "alt": True},
("gpencil.select", {"type": params.select_mouse, "value": params.select_mouse_value, "alt": True},
("gpencil.select", {"type": params.select_mouse, "value": params.select_mouse_value, "shift": True, "alt": True},
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "alt": True},
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
("paint.weight_gradient", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
("paint.weight_gradient", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True},
("mesh.loop_select", {"type": params.select_mouse, "value": params.select_mouse_value, "alt": True},
("mesh.loop_select", {"type": params.select_mouse, "value": params.select_mouse_value, "shift": True, "alt": True},
("mesh.edgering_select", {"type": params.select_mouse, "value": params.select_mouse_value, "ctrl": True, "alt": True},
("mesh.edgering_select", {"type": params.select_mouse, "value": params.select_mouse_value, "shift": True, "ctrl": True, "alt": True},
("mesh.loop_select", {"type": params.select_mouse, "value": 'DOUBLE_CLICK', "alt": True},
("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),
("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),
("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),
("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None),

Revisions and Commits

Event Timeline

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to 50.Aug 30 2019, 9:10 AM

Maybe I am not quite sure I understand correctly, but everytime I travel, teach or use Blender somwhere else on the road, I am doing that on a MacBookPro, and I always use the EmulateMiddleMouseButton there. I would be completely lost without it.

I know that some users use this option because (cheap, old?) devices need a lot more pressure on the MMB scroll wheel.
Personally, I would prefer to remove this option because it causes many issues. Using a suitable external device is, in my opinion, in the end less painful.

For example, in the 3D view, it also breaks the currently free Ctrl-Alt-LMB that I use for viewport-roll.
And there is no reasonable way to fix that: https://developer.blender.org/T31392#765200

I on windows that on linux I have always used emulate middle mouse button both with the touchpad and with the tablet pen, and I use the combinations
alt + left click = rotate view
alt + ctrl + left click = zoom view
alt + shift + left click = pan view
alt + left click for scrolling in the ourliner and panels ...

for me these functions are essential, the rest I can't say ..

For trackpad and pen tablet usage I think this option is still important.

I don't think we can rely on middle mouse click being available. For pen tablets right mouse click is already more limited in what you can do efficiently, nevermind middle mouse click.

I've had a good experience using Spacebar as an MMB stand-in on laptops, re-mapping the standard actions (search, play animation, maximize area, etc) to double-click and using click-drag for rotating the viewport. I like enough that I use a similar keymap layering system on my desktop, as it lets me use Spacebar as a modifier key for LMB and RMB, too.

I have a fully functional middle mouse button and often use this, because it's imo more comfortable. I'm on rightclick select though

I use this option with all my devices - most modern mice don't have a real MMB, but a scroll wheel, which is really not very nice to press.

Grease Pencil, Circle Primitive

We have a tool for this

Weight Paint Gradient

We have a tool for this

Loop select (Worked around with double-click, but not very convenient since selecting boundaries requires quad-click).

We have a workaround as you say.

Having a tool for a feature isn't a great excuse for allowing conflicts, if someone is following a tutorial or a set of steps, they might not be able to perform the same steps.

You don't have to look far in the larger list of bindings to find issues that can't be worked around.

For example, with emulate-mmb, it's impossible to edge-ring-deselect with LMB-select, or lasso-select mask/clips with RMB-select.

Sequencer linked-select options also don't seem to have an alternative.

the logic wants blender should be totally functional with two buttons, and the third-middle button should be optional for those who "use them - enable them"

  • All the devices have 2 buttons
  • 3 buttons only some mouse

If the goal is to minimize the keymap impact, we could swap the right-click menus from press to click, use right tweak for panning, and set the modifier keys to swap between Move/Rotate/Zoom within the modals. We'd have to adjust the stencil controls for painting and sculpting, but we should be able to nudge things around and use Ctrl+Shift and Ctrl+Alt+Shift for displaced functions. It feels pretty smooth when you're using a tablet, with or without Confirm on Release.

Why not add an more key options to emulate Middle Mouse Button, such as using the "Fn" button for laptop users? Possibly with a dropdown of keys?

I think that the problem of using "Alt" and "Left Mouse" click will always be there, but it is better to have the option for users without a mouse, which my guess is probably many laptop users. There should be a warning on the option that informs the user that there may be keymap conflicts by using the option.

Not only laptop users benefit from middle mouse emulation, the first time i use blender with that option and a tablet it worked great, that was one of those things that remove presasure from my right hand, not need to claw a finger to keep a middle mouse pushed was great and it still is today i basically only work with table mouse its only for games at this point.
If you are wondering about how do i select without doing a claw with my index or middle finger, i use right click with the side of my thumb (on the pen) or usually ctrl+left click (pen tip) to lasso select
Emulate 3 mouse button its not a default option, shouldn't actually be a problem if some noob its following a tutorial, becaouse probably never new that the option existed in the first place.
By the way alt+changing a parameter also doesn't work properly, i really don't care about that shortcut just use contextual menu>copy to selected, just mentioned if you wanted to added to the list.

I've had a good experience using Spacebar as an MMB stand-in on laptops, re-mapping the standard actions (search, play animation, maximize area, etc) to double-click and using click-drag for rotating the viewport. I like enough that I use a similar keymap layering system on my desktop, as it lets me use Spacebar as a modifier key for LMB and RMB, too.

While I didn't try this - I have tried different kinds of input, in general they can work as a custom configuration, however I don't think it's reasonable to map mouse buttons to the keyboard entirely.


Why not add an more key options to emulate Middle Mouse Button, such as using the "Fn" button for laptop users? Possibly with a dropdown of keys?

the Fn key isn't seen as a modifier, we can't use it.

While having the option to select between multiple keys can work - it means we can have multiple options that conflict in different paces - which would be better to avoid.


If the goal is to minimize the keymap impact, we could swap the right-click menus from press to click, use right tweak for panning, and set the modifier keys to swap between Move/Rotate/Zoom within the modals. We'd have to adjust the stencil controls for painting and sculpting, but we should be able to nudge things around and use Ctrl+Shift and Ctrl+Alt+Shift for displaced functions. It feels pretty smooth when you're using a tablet, with or without Confirm on Release.

Differentiating RMB drag/click events work with Right-Click-Select. It's also likely to limit different kinds of interactions (during modal operators for example).

It can work for the 3D view but is unlikely to work well for event handling in general.

Since it seems there are enough devices that don't have access to MMB, we could use OSKey (Cmd/Super/Win) key, instead of Alt.

While we should continue to avoid using OSKey for other default bindings, an exception in this case would allow us to it for MMB-emulation without running into conflicts.

Pros:

  • Conflict free, MMB emulation can be fully supported without conflicts.
  • Simple to implement, can be used on all platforms.

Cons:

  • On Linux this is often used to move the window, although it can be configured not to.
  • On macOS it would mean you couldn't use Cmd for Ctrl when used with the mouse, this is a trade-off. All shortcuts can still be accessed because Ctrl can be used in those cases. This is already the case when Cmd use used by the window-manager.

Are there any other issues with this?

Emulate 3 Buttons doesn't work with ALT Modifier key on UI buttons

https://developer.blender.org/T69053

I always use the emulate. I don't see the problem while a lot of 3D software works with these keys. It's much more convenient with a graphics tablet. When you have several years of practice and tendonitis full of arms you will understand why the emulate is so important. the navigational functions are used every second and it is very tiring for the right hand to do gymnastics on 3 buttons and the worst is probably the middle button. I don't see a more practical position for the left hand than the alt shift ctrl.

Translated with www.DeepL.com/Translator

One of the mail uses of Emulate 3 Button Mouse is for graphics tablets where you actually often don’t have MMB at all, or even if you do, you cannot really use it for dragging. This makes removing this a non-starter, unless we provide a separate keymap especially for graphics tablets.

As already stated:

Since it seems there are enough devices that don't have access to MMB, we could use OSKey (Cmd/Super/Win) key, instead of Alt.

Any feedback on this?

There is a problem I would like to point out, there are some stupid keyboards (especially on laptops) that have the key lock for the combination of keys that are not ctrl or alt or shift + mouse movement ....
for example if I hold down "A" and I move the mouse, this doesn't work (especially the touchpad) ...
So the combinations Alt or ctrl or shift are essential ...

Some keyboards block the touchpad if you press space ...
(combination widely used in 2d drawing programs)
Ad don't even allow the classic wasd that is used to play video games.
I know it's a very mangy thing ... but I wanted to make it clear that these problems exist.

Some stupid keyboards / touchpads don't even allow you to disable "this function."

As already stated:

Since it seems there are enough devices that don't have access to MMB, we could use OSKey (Cmd/Super/Win) key, instead of Alt.

Any feedback on this?

If I read your suggestion correctly this is only OSKey + mouse move? as I in it won't stop cmd+c, cmd+v etc. working - I think this is a good compromise - doesn't the OS Key open the start menu on Windows?

If I read your suggestion correctly this is only OSKey + mouse move? as I in it won't stop cmd+c, cmd+v etc. working - I think this is a good compromise - doesn't the OS Key open the start menu on Windows?

It would be OSKey-LMB (instead of Alt-LMB).

If I read your suggestion correctly this is only OSKey + mouse move? as I in it won't stop cmd+c, cmd+v etc. working - I think this is a good compromise - doesn't the OS Key open the start menu on Windows?

It would be OSKey-LMB (instead of Alt-LMB).

For touchpads, a modifier key that works without LMB would be much more convenient; especially for touchpads with integrated mouse buttons it can be very hard to press the mouse button and move the cursor at the same time. Also multitouch gestures (as already enabled on macOS) would obviate the need for using a key combination most of the time for many touchpads.

Using the OSkey is a no-go on Windows. It breaks convention and produces unwanted behavior on key release, Suppressing that behavior would get messy, interfering with expected OS behavior. The OSkey is in a great position, but it comes with a ton of baggage (on Windows).

Is the goal to create a key combo that emulates the middle mouse button, or to create a keyboard layout for users that don't have a middle mouse button? I've realized that my suggestions have been targeting the latter, and they don't really solve the former.

We intentionally changed macOS to use cmd key to get more standard keyboard shortcuts, it would be unfortunate to give that up. Conflicting with default operating system configuration to move windows on Linux is also problematic.

I'm not convinced this is a pressing issue that we need to solve in a different way, that's it's worth the effort and pain of shaking things up. Yes it's a bit messy and it's not ideal that some functionality is not available with an easy shortcut when using middle mouse emulation. But what we have now is also generally usable.

We just did a lot of keymap changes in 2.80, I'd rather postpone this kind of change that affects commonly used shortcuts for many users.

Using the OSkey is a no-go on Windows. It breaks convention and produces unwanted behavior on key release, Suppressing that behavior would get messy, interfering with expected OS behavior. The OSkey is in a great position, but it comes with a ton of baggage (on Windows).

From looking into the WIN32 API, it looks possible to handle the windows key events, suppressing the start menu when used to emulate MMB.


We intentionally changed macOS to use cmd key to get more standard keyboard shortcuts, it would be unfortunate to give that up.

This could be done so it only impacts Ctrl-Click events (when MMB emulation is enabled). Nearly all shortcuts using Cmd would still work.

Conflicting with default operating system configuration to move windows on Linux is also problematic.

Agree, not great. OTOH, the current situation is quite bad too.

I'm not convinced this is a pressing issue that we need to solve in a different way, that's it's worth the effort and pain of shaking things up. Yes it's a bit messy and it's not ideal that some functionality is not available with an easy shortcut when using middle mouse emulation. But what we have now is also generally usable.
We just did a lot of keymap changes in 2.80, I'd rather postpone this kind of change that affects commonly used shortcuts for many users.

Whatever we do in this case - its a non-default keymap option, so having an alternate way to access MMB emulation may not be such a big change.

If we choose not to *solve* this, the documentation for MMB emulation should state something to this effect:

Middle mouse button emulation gives reduced functionality, making actions such as editing multiple object values at once and some selection operations impossible. For all operations to be accessible, use an input device with a middle mouse button.
... list all operations which can't be accessed w/ MMB-emulation.

I've used emulate mmb since the start maybe a decade ago, because I built up muscle memory for alt-orbiting and panning with a pen tablet from other software. For multiple reasons I would highly prefer to not have to readjust.

I can see the issues using alt as a modifier causes, and I think having an option to use the space-lmb as mmb emulation could make sense. Spacebar as the button my thumb is resting on nearly 100% of the time criminally underused as someone who doesn't work on animations, activates tools mostly with hotkeys, and got used to F3 being the search key, which I imagine represents a sizeable chunk of the userbase. Shift-space to activate playback, and ctrl-space to maximize the viewport seem much simpler to relocate. As an added bonus, changing from alt-lmb to space-lmb doesn't feel as major of an adjustment than using mmb for orbit. Most mice I've used make my finger hurt if I use the middle button too much. Even adding the option to specify your own preference either for the modifier would help, with the user picking the trade-off they prefer.

Additionally for those of us that have a middle mouse button but it's inconvenient to use, it doesn't need to work universally everywhere, for example alt-clicking a button doesn't need to translate to a middle mouse press since it's a much less frequent action than orbiting or panning the view, so it could be context-sensitive without having to make major compromises or losing functionality. Possibly slightly confusing to have exceptions to the rule, but personally it took me a long time to realize that mmb emulation is completely universal instead of context sensitive to orbiting and panning actions as I assumed it would be. As for rebinding options, currently I believe with left click select alt-rmb does nothing in any context, which for example could be interpreted as an alt- lmb with mmb emulation enabled, or alt rmb drag to change views.

I don't know if any of my suggestions are viable but I can still see a lot of improvements that can be made.

Hello, i am testing the OS-Key to emulate the MMB and it works well in GNU/Linux with GNOME desktop environment but i had to disable the "Window Action Key" in Gnome Tweaks and disable the OS-Key ( super key ) shortcut with the terminal.

During the walk navigation " shift + ` ", it would be useful assign the teleport to the OS-Key instead of the middle mouse.

Anyway the option to "Emulate Middle Mouse" is very important, in particular working with a pen/tablet ! Thank you.

Emulate MMB is just indispensable with any kind of pen input devices. Buttons on pens are generally unreliable - in that you can't rely on it that they exist at all, and how many.

Just please do not use "OS-Key" name in UI, such key does not exist.
Instead use Cmd/Win/Super according to the operating system.

@Yevgeny Makarov (jenkm) yes indeed. Nicest would be if we could use the correct name depending on the platform.

@Yevgeny Makarov (jenkm) - Just please do not use "OS-Key" name in UI, such key does not exist. Instead use Cmd/Win/Super according to the operating system.

There are some times times right now when "OS-Key" is exposed to users. But I personally wasn't planning on addressing that until we update our font binaries so they include symbols for these keys in https://developer.blender.org/D6055 Most of the time we don't want to expose a name but a symbol.

I used grless to emulate middle mouse button and it's working perfectly.

This preference for "Emulate Middle Mouse" should be removed.
Alternative shortcuts must be present in the default keymap, so you can easily use mouse, trackpad and tablet pen at the same time.
No need for options that remap buttons globally, this is confusing, it's hard to think about all the possible changes in all shortcuts in all editors.
When you emulate MMB or Numpad this does not change the shortcuts in the tooltips, again confusing.
I would even say that the need for "Emulate" creates a bad user experience, it looks like some kind of inferiority of your equipment.
So, always use Alt+Mouse as an alternative to MMB, and change conflicting shortcuts.
Using the Win/Super key as a modifier does not look like a good idea because these keys are not intended for such purposes.
No need for these ugly hacks in the 2020.
Anyway, "Emulate Middle Mouse" and "Emulate Numpad" should be in the Keymap > Preferences, and reassign some specific keys rather than remap globally.

Could we use a long press event here? I mentioned them on DevTalk the other day, in the context of how we could build on top of D5153, and I think this could be an interesting test-case for the idea.

Long press doesn't work well for tweak or any action that's expected to operate on mouse-down.

That'd depend on how you use it, wouldn't it? If we activated pan/orbit/zoom on drag, we could use long press as a fall-through. You'll notice a hitch if you use a larger drag threshold, but that can be fixed with a two-line tweak to wm_handlers_do.

I tried to replace MMB with alt+LMB but it looks like it is not fully possible yet

  • the Generic Gizmo hotkeys are not exposed so it's not possible to set gizmos to work with alt+LMB the same way they work with MMB(it's odd since you can search for gizmo hotkeys)
  • panel hotkeys take no effect for alt or shift + LMB so changing those hotkeys in View2D button list just doesn't work

also, even though alt+LMB can be set together with MMB it will not work for addons anymore unless those hotkeys will be supported by creators as well, it may hit tablet users
emulate is an extremely elegant solution

Hi! As a premise, I don't use the emulate-3-button option, even the few times I use a tablet in blender I have mapped the MMB to one of the side buttons of the pen, so sorry in advance if I'm missing something here.

I was wondering though if there was any major issue in assigning the emulate option based on the user selection mode, so Alt+RMB for left-click-select, and Alt+LMB for right-click-select.
It would require to switch some of the existent shortcuts but from what I can see they are mostly lasso-selections, that are in fact inconsistent with the selection button.