Fix T96395: NDOF entries prevent loading of custom keymaps in 3.2
Even though the default key-map didn't use NDOF types some key-maps did.
This commit is contained in:
parent
82e7956f12
commit
c6642f06ab
@ -14,11 +14,11 @@ def keyconfig_update(keyconfig_data, keyconfig_version):
|
|||||||
|
|
||||||
# Version the key-map.
|
# Version the key-map.
|
||||||
import copy
|
import copy
|
||||||
|
# Only copy once.
|
||||||
has_copy = False
|
has_copy = False
|
||||||
|
|
||||||
# Default repeat to false.
|
# Default repeat to false.
|
||||||
if keyconfig_version <= (2, 92, 0):
|
if keyconfig_version <= (2, 92, 0):
|
||||||
# Only copy once.
|
|
||||||
if not has_copy:
|
if not has_copy:
|
||||||
keyconfig_data = copy.deepcopy(keyconfig_data)
|
keyconfig_data = copy.deepcopy(keyconfig_data)
|
||||||
has_copy = True
|
has_copy = True
|
||||||
@ -31,7 +31,6 @@ def keyconfig_update(keyconfig_data, keyconfig_version):
|
|||||||
item_event["repeat"] = True
|
item_event["repeat"] = True
|
||||||
|
|
||||||
if keyconfig_version <= (3, 2, 5):
|
if keyconfig_version <= (3, 2, 5):
|
||||||
# Only copy once.
|
|
||||||
if not has_copy:
|
if not has_copy:
|
||||||
keyconfig_data = copy.deepcopy(keyconfig_data)
|
keyconfig_data = copy.deepcopy(keyconfig_data)
|
||||||
has_copy = True
|
has_copy = True
|
||||||
@ -48,4 +47,19 @@ def keyconfig_update(keyconfig_data, keyconfig_version):
|
|||||||
item_event["direction"] = value
|
item_event["direction"] = value
|
||||||
item_event["value"] = 'CLICK_DRAG'
|
item_event["value"] = 'CLICK_DRAG'
|
||||||
|
|
||||||
|
if keyconfig_version <= (3, 2, 6):
|
||||||
|
if not has_copy:
|
||||||
|
keyconfig_data = copy.deepcopy(keyconfig_data)
|
||||||
|
has_copy = True
|
||||||
|
|
||||||
|
for _km_name, _km_parms, km_items_data in keyconfig_data:
|
||||||
|
for (_item_op, item_event, _item_prop) in km_items_data["items"]:
|
||||||
|
if ty_new := {
|
||||||
|
'NDOF_BUTTON_ESC': 'ESC',
|
||||||
|
'NDOF_BUTTON_ALT': 'LEFT_ALT',
|
||||||
|
'NDOF_BUTTON_SHIFT': 'LEFT_SHIFT',
|
||||||
|
'NDOF_BUTTON_CTRL': 'LEFT_CTRL',
|
||||||
|
}.get(item_event.get("type")):
|
||||||
|
item_event["type"] = ty_new
|
||||||
|
|
||||||
return keyconfig_data
|
return keyconfig_data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user