The current implementation of Middle Mouse Emulation (Alt + LMB) conflicts with the Left Click Select keymap and there isn’t a clean one-step solution. Lots of options have been discussed, but we don’t have a firm rubric to judge them against or a roadmap for testing them. I’m going to talk about that here, rather than on Phabricator, to spare everyone the email spam.
How MMB Emulation Works Right Now
The MMB emulation option in the user preferences isn’t a keymap tweak; when it’s enabled, Blender interprets Alt + LMB as an actual MMB event. This is why it works for things like axis constraints in transform modals, which can’t remapped otherwise.
You can see the relevant code for this in wm_event_system.c
near line 4157. It’s fairly straightforward.
What’s Wrong with It?
From the task on Phabricator, here’s what it messes with in the Left Click Select keymap:
- 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).
Trying to design keymaps around a feature that blocks a particularly useful chunk of input space for a non-trivial portion of the user base is a pain, and expecting users to customize around it feels like a punt.
A Rubric for Better Implementations
Ideally, MMB emulation should:
- Avoid keymap conflicts
- Require minimal documentation
- Fit Blender’s general input schema
- Work for both touchpads and pens
In order to make these requirements more feasible, we’ll inevitably discuss ways we can:
- Adjust the default keymaps to remove conflicts
- Use status signalling in the viewport to communicate changed behaviors
- Clarify Blender’s input schema through documentation, microcopy, and icons
- Improve input recognition for touchpad and pen gestures
Solutions I’ve Tested
Testing basic key combinations is fairly easy; it’s just a matter of adjusting the relevant lines in wm_event_system.c
and recompiling. Here’s a few that I’ve played with:
Spacebar + LMB
When a user opens Blender for the first time, one of the first things they see is the option to re-assign the Spacebar. It’s presented as a hotkey they’re “supposed” to customize; adding MMB emulation to that list of quick configurations would be an easy sell.
I swapped the existing Spacebar hotkeys from press to double-click when I tested the configuration, as it was the lowest-impact change I could think of. I had to adjust the transform modal map the ‘hard way’ in order to retain full MMB functionality, but I haven’t had any issues with it so far.
This is my favorite option at the moment, but I’m biased by the fact that I’ve used the Spacebar as a modifier, double-click Spacebar hotkeys, for a while now.
Q + LMB
Using an alphanumeric key as a modifier for MMB emulation isn’t ideal, by any stretch, but I wanted to experiment with one anyway. I decided to test Q because it’s a well-positioned key in the left key cluster that only has two popular functions mapped to it, neither of which are modal.
Here’s Q in the default keymap:
- Q → Quick Menu
- Ctrl + Q → Quit Blender
- Ctrl + Alt + Q → Quad View
- Shift + Q → Toggle Grease Pencil Overlay
- Shift + Alt + Q → Toggle Grease Pencil Overlay
As I did with Spacebar + LMB, I remapped these hotkeys from press to double-click. Q’s in a great position for a navigation key, and it can be used for MMB emulation without altering the transform modal map. Using Q doesn’t fit Blender’s input schema, but it is the most ergonomic key I’ve tested.
[Anything] + RMB
RMB is consistently used to cancel things, and using it for MMB emulation would require tweaking modal maps, keymaps, and UI behaviors. This overhead, and the number of laptops with poorly designed integrated mouse buttons, makes RMB an ineffective choice.
I love using it for panning and gizmo interactions with a proper mouse, but I couldn’t find a user friendly key combo that used it for MMB emulation.
Capslock + [Anything]
Capslock is my white whale; I’ve managed to make it work as a hold-to-emulate key, but I haven’t worked the kinks out using it as a toggle. I’ll keep chipping away at it for my own entertainment, but I don’t see it working out as a user-friendly key for modifying core behaviors.
Things I Can’t Test
I can churn out patches and quote HCI studies, but I can’t break into your house and test your input devices for you. I’m not in a good position to test multi-platform support and I haven’t had a chance to test anything with the Industry Standard Keymap. I can test pen input, but not touch screens.
There are also some solutions that are too complex for me to implement explorativey, like differentiating between right and left modifier keys, and limiting MMB emulation to dynamic action zones. I’m some random schmuck who decided to Kool Aid Man my way into someone else’s design task and I’m still getting to know Blender’s codebase.