Page MenuHome

Keymaps: replace select / action mouse system.
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Thu, Nov 15, 3:31 PM.

Details

Summary

For Blender builtin configurations the option to choose the select mouse remains
and is now also in the splash screen. It works by changing the keymap dynamically
in the script, rather than using special events.

The system of automatic switching of events was not flexible enough to deal with
side effects that require further keymap changes, so it is now under more manual
control in the script.

This breaks compatibility for some scripts and exported key configurations.
These can be fixed by replacing SELECTMOUSE, ACTIONMOUSE, EVT_TWEAK_S and
EVT_TWEAK_A with appropriate LEFTMOUSE, RIGHTMOUSE, EVT_TWEAK_L and
EVT_TWEAK_R events.

Other than that, there should be no functional changes.

Diff Detail

Event Timeline

Campbell Barton (campbellbarton) added inline comments.
source/blender/makesdna/DNA_windowmanager_types.h
365

We could make this part of a more general keyconfig preferences. OTOH - it's fine for now too.

This revision is now accepted and ready to land.Thu, Nov 15, 10:04 PM
release/scripts/presets/keyconfig/keymap_data/blender_default.py
45–47

Rather this doesn't depend on Blender (bpy module),
it's quite handy to be able to run this outside of blender to extract data & compare it.

Also for scripts re-using data from the keymap it helps if it only uses input arguments.

Applied rB088be7eb2f650f7849e3af33cbea76f7b3af0822 with minor changes:

  • Keyconfig names are now always based on the filename, not doing this causes errors setting the keymap.
  • Remove bpy use in blender_defaults.py - to keep this a data file we can inspect/reuse. Pass in via presets instead.
  • Move use_select_mouse into own struct member (we may remove when custom props are added, avoid deprecated flags hanging around).