Skip to content

Commit

Permalink
feat!: changed modifier to force open directory in file menus from `c…
Browse files Browse the repository at this point in the history
…trl` to `alt`

To force open a directory instead of navigating to it, you now need to use `alt+enter` or `alt+click` (previously `ctrl`).

`ctrl+enter` has been reassigned to search submit.
  • Loading branch information
tomasklaen committed Oct 14, 2023
1 parent 074a1ee commit 6dfef3d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ To change the font, **uosc** respects the mpv's `osd-font` configuration.
These bindings are active when any **uosc** menu is open (main menu, playlist, load/select subtitles,...):
- `up`, `down` - select previous/next item
- `left`, `right` - back to parent menu or close, activate item
- `enter` - activate item
- `esc` - close menu
- `wheel_up`, `wheel_down` - scroll menu
- `pgup`, `pgdwn`, `home`, `end` - self explanatory
- `ctrl+f` or `\` - in case `menu_type_to_search` is disabled, these two trigger the menu search instead
- `ctrl+enter` - submits a search in menus without instant search
- `ctrl+up/down` - move selected item in menus that support it (playlist)
- `del` - delete selected item in menus that support it (playlist)
- `shift+enter`, `shift+right` - activate item without closing the menu
- `ctrl+enter`, `ctrl+click` - force activate an item, even if it's a submenu. In practical terms: activates a directory instead of navigation to its contents.
- `up`, `down` - Select previous/next item.
- `left`, `right` - Back to parent menu or close, activate item.
- `enter` - Activate item.
- `esc` - Close menu.
- `wheel_up`, `wheel_down` - Scroll menu.
- `pgup`, `pgdwn`, `home`, `end` - Self explanatory.
- `ctrl+f` or `\` - In case `menu_type_to_search` is disabled, these two trigger the menu search instead.
- `ctrl+enter` - Submits a search in menus without instant search.
- `ctrl+up/down` - Move selected item in menus that support it (playlist).
- `del` - Delete selected item in menus that support it (playlist).
- `shift+enter`, `shift+right` - Activate item without closing the menu.
- `alt+enter`, `alt+click` - In file navigating menus, opens a directory in mpv instead of navigating to its contents.
Click on a faded parent menu to go back to it.
Expand Down
5 changes: 5 additions & 0 deletions scripts/uosc/elements/Menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -937,14 +937,19 @@ function Menu:enable_key_bindings()
self:create_key_action('open_selected_item_soft', {shift = true}))
self:add_key_binding('shift+mbtn_left', 'menu-select3', self:create_modified_mbtn_left_handler({shift = true}))
self:add_key_binding('ctrl+mbtn_left', 'menu-select4', self:create_modified_mbtn_left_handler({ctrl = true}))
self:add_key_binding('alt+mbtn_left', 'menu-select4', self:create_modified_mbtn_left_handler({alt = true}))
self:add_key_binding('mbtn_back', 'menu-back-alt3', self:create_key_action('back'))
self:add_key_binding('bs', 'menu-back-alt4', self:create_key_action('key_bs'), {repeatable = true, complex = true})
self:add_key_binding('enter', 'menu-select-alt3', self:create_key_action('open_selected_item_preselect'))
self:add_key_binding('kp_enter', 'menu-select-alt4', self:create_key_action('open_selected_item_preselect'))
self:add_key_binding('ctrl+enter', 'menu-select-ctrl1',
self:create_key_action('key_ctrl_enter', {ctrl = true}))
self:add_key_binding('alt+enter', 'menu-select-alt1',
self:create_key_action('open_selected_item_preselect', {alt = true}))
self:add_key_binding('ctrl+kp_enter', 'menu-select-ctrl2',
self:create_key_action('open_selected_item_preselect', {ctrl = true}))
self:add_key_binding('alt+kp_enter', 'menu-select-alt2',
self:create_key_action('open_selected_item_preselect', {alt = true}))
self:add_key_binding('shift+enter', 'menu-select-alt5',
self:create_key_action('open_selected_item_soft', {shift = true}))
self:add_key_binding('shift+kp_enter', 'menu-select-alt6',
Expand Down
2 changes: 1 addition & 1 deletion scripts/uosc/lib/menus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function open_file_navigation_menu(directory_path, handle_select, opts)
return
end

if info.is_dir and not meta.modifiers.ctrl then
if info.is_dir and not meta.modifiers.alt then
-- Preselect directory we are coming from
if is_to_parent then
inheritable_options.selected_path = directory.path
Expand Down

0 comments on commit 6dfef3d

Please sign in to comment.