From 1601413b63c1355fbb467c45b740c4f021b43f5f Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Sun, 8 Sep 2019 20:31:12 +0200 Subject: UI: Allow file number shortcuts ouside main region Makes the numpad + and - type of shortcuts to increase/decrease the file number suffix work in the upper and lower bar of the file browser. Had to add keymap handlers to the execute region for this to work. --- .../keyconfig/keymap_data/blender_default.py | 24 +++++++++++----------- .../keymap_data/industry_compatible_data.py | 24 +++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'release') diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 89563b6f64d..cd3dff55d47 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -1788,6 +1788,18 @@ def km_file_browser(_params): ("file.directory_new", {"type": 'I', "value": 'PRESS'}, None), ("file.smoothscroll", {"type": 'TIMER1', "value": 'ANY', "any": True}, None), ("file.bookmark_add", {"type": 'B', "value": 'PRESS', "ctrl": True}, None), + ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, + {"properties": [("increment", 1)]}), + ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True}, + {"properties": [("increment", 10)]}), + ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, + {"properties": [("increment", 100)]}), + ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, + {"properties": [("increment", -1)]}), + ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True}, + {"properties": [("increment", -10)]}), + ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, + {"properties": [("increment", -100)]}), ]) return keymap @@ -1848,18 +1860,6 @@ def km_file_browser_main(params): ("file.highlight", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None), ("file.sort_column_ui_context", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), op_menu("FILEBROWSER_MT_context_menu", params.context_menu_event), - ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, - {"properties": [("increment", 1)]}), - ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True}, - {"properties": [("increment", 10)]}), - ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, - {"properties": [("increment", 100)]}), - ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, - {"properties": [("increment", -1)]}), - ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True}, - {"properties": [("increment", -10)]}), - ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, - {"properties": [("increment", -100)]}), ]) return keymap diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py index d1cd27296e1..27cae25bd88 100644 --- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py +++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py @@ -1181,6 +1181,18 @@ def km_file_browser(params): ("file.smoothscroll", {"type": 'TIMER1', "value": 'ANY', "any": True}, None), ("file.bookmark_toggle", {"type": 'T', "value": 'PRESS'}, None), ("file.bookmark_add", {"type": 'B', "value": 'PRESS', "ctrl": True}, None), + ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, + {"properties": [("increment", 1)]}), + ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True}, + {"properties": [("increment", 10)]}), + ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, + {"properties": [("increment", 100)]}), + ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, + {"properties": [("increment", -1)]}), + ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True}, + {"properties": [("increment", -10)]}), + ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, + {"properties": [("increment", -100)]}), ]) return keymap @@ -1243,18 +1255,6 @@ def km_file_browser_main(params): ("file.highlight", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None), ("file.sort_column_ui_context", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), op_menu("FILEBROWSER_MT_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}), - ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, - {"properties": [("increment", 1)]}), - ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True}, - {"properties": [("increment", 10)]}), - ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, - {"properties": [("increment", 100)]}), - ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, - {"properties": [("increment", -1)]}), - ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True}, - {"properties": [("increment", -10)]}), - ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, - {"properties": [("increment", -100)]}), ]) return keymap -- cgit v1.2.3