13 Commits

Author SHA1 Message Date
Campbell Barton
024ac9c089 Fix T84549: Keymap presets written without repeat enabled
Key map items using TEXTINPUT didn't include the repeat setting.
2021-01-14 20:52:36 +11:00
Campbell Barton
245450b144 Fix exported keymaps loading in 2.91 and older
The generated keymaps used a keyword argument that doesn't exist
in older Blender versions.
2020-12-17 00:53:28 +11:00
Robert Guetzkow
f7320c3bf1 Fix T82292: Set encoding for keymap export to UTF-8
Keymaps have previously been exported with an encoding dependent
on the current system locale. This caused issues when the
keymap contained non-ASCII characters, for instance in a string
property for an operator.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9449
2020-11-04 13:20:10 +01:00
Campbell Barton
f5080c82dd Keymap: disable 'repeat' by default for keymap items
In practice, there are only a limited number of operations we need to
use repeat such as navigation, stepping operations that cycle states
and text input.

Now we don't need to disable repeat explicitly when a modal operator
uses checks for a key being held as was needed for 17cb2a6da0c88.

Repeat is now included in exported keymaps.

Use versioning so existing exported keymaps are loaded properly.
2020-10-22 12:29:45 +11:00
Campbell Barton
358a584985 Keymap: add support for versioning keymaps
Write the Blender version into the keymap
so we can change defaults without breaking existing keymaps.

Based on patch by @erik85 with own additions.
2020-10-22 12:29:42 +11:00
Roman Kornev
95f51bb01d Keymap: sort exported key-maps
This makes the resulting key-maps easier to compare.
2020-04-06 23:37:54 +10:00
Campbell Barton
493fa59225 Fix keymap export of enum-flag properties 2019-09-06 04:44:12 +10:00
Brecht Van Lommel
604fdb6e85 Spelling fixes in comments and descriptions, patch by luzpaz
Differential Revision: https://developer.blender.org/D3744
2019-07-31 14:27:35 +02:00
Campbell Barton
69bf4e5e36 Cleanup: unused variables 2019-03-17 21:14:43 +11:00
Campbell Barton
3b3eac3d4b Keymap: tweak keymap loading type checks
For full keymaps, ensure keymap items are lists to allow predictable
manipulation at runtime.

When calling `keymap_init_from_data` directly, allow any sequence type
to allow tools to define their keymaps as tuples.
2019-03-14 15:53:48 +11:00
Campbell Barton
e1b8645c6a Keymap: use strict format for keymap definitions
Ensure we use lists for keymap items and item properties.

This means scripts can access keymap definitions from other layouts,
manipulating them without sometimes encountering a tuple that needs
to be converted into a list.
2018-12-02 14:02:03 +11:00
Campbell Barton
d0ac13d6b1 Cleanup: minor simplification of keyconfig merge 2018-11-22 16:33:57 +11:00
Campbell Barton
f8c16b0175 Cleanup: move bpy_extras.keyconfig_utils to own module
bpy_extras were meant to be useful high-level helper functions for
script authors to perform common operations,
to avoid writing to verbose API's.

bpy_extras.keymap_utils contains some specialized API calls
mainly intended for Blender's own internal use.

Move keymap import export to internal API.
2018-11-20 11:06:01 +11:00