Fix T79738: Double Click does not opening folders in File Browser

If the File Browser was used in regular editor mode (e.g. not through an
operation like File > Open), the operator that usually opens files and
directories wouldn't execute. We need to keep two operators for
double-click in the keymap so selecting and opening works in all cases.

Caused by c606044157.
This commit is contained in:
Julian Eisel 2020-08-12 19:20:42 +02:00
parent b3165fb8b5
commit ba2d1c8898
Notes: blender-bot 2023-02-14 05:44:22 +01:00
Referenced by issue #79989, File Browser: `Return` shortcut does not work for opening folders
Referenced by issue #79738, Double Click does not opening folders in File Browser
Referenced by issue #79654, File Browser navigation bug
1 changed files with 6 additions and 0 deletions

View File

@ -1926,6 +1926,12 @@ def km_file_browser_main(params):
items.extend([
("file.execute", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'},
{"properties": [("need_active", True)]}),
# Both .execute and .select are needed here. The former only works if
# there's a file operator (i.e. not in regular editor mode) but is
# needed to load files. The latter makes selection work if there's no
# operator (i.e. in regular editor mode).
("file.select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'},
{"properties": [("open", True), ("deselect_all", not params.legacy)]}),
("file.refresh", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None),
("file.select", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("open", False), ("deselect_all", not params.legacy)]}),