File Browser: Add F2 shortcut to rename files
Previously, we used Ctrl+Click for renaming, but since that shortcut is now consistently used to add items to the selection, we can't use that. In other cases we switched to F2 now, so it makes sense for the File Browser too. Further, AFAIK renaming was only possible through the context menu, which makes it hard to discover in the right click select keymap (have to press W). Note that I had to do some internal changes to ensure the context menu always acts on the clicked/hovered item, while the shortcut operates on the active item. William and I agreed that this is likely the behavior expected by most users.
This commit is contained in:
@@ -1793,6 +1793,7 @@ def km_file_browser(params):
|
||||
{"properties": [("data_path", 'space_data.params.show_hidden')]}),
|
||||
("file.directory_new", {"type": 'I', "value": 'PRESS'},
|
||||
{"properties": [("confirm", False)]}),
|
||||
("file.rename", {"type": 'F2', "value": 'PRESS'}, None),
|
||||
("file.delete", {"type": 'X', "value": 'PRESS'}, None),
|
||||
("file.delete", {"type": 'DEL', "value": 'PRESS'}, None),
|
||||
("file.smoothscroll", {"type": 'TIMER1', "value": 'ANY', "any": True}, None),
|
||||
|
||||
@@ -1183,6 +1183,7 @@ def km_file_browser(params):
|
||||
{"properties": [("data_path", 'space_data.params.show_hidden')]}),
|
||||
("file.directory_new", {"type": 'I', "value": 'PRESS'},
|
||||
{"properties": [("confirm", False)]}),
|
||||
("file.rename", {"type": 'F2', "value": 'PRESS'}, None),
|
||||
("file.delete", {"type": 'DEL', "value": 'PRESS'}, None),
|
||||
("file.smoothscroll", {"type": 'TIMER1', "value": 'ANY', "any": True}, None),
|
||||
("wm.context_toggle", {"type": 'T', "value": 'PRESS'},
|
||||
|
||||
Reference in New Issue
Block a user