Skip to content

Commit

Permalink
fix: main menu ignoring alt modifier (activate without closing)
Browse files Browse the repository at this point in the history
closes #1046
  • Loading branch information
tomasklaen committed Jan 12, 2025
1 parent cbce3d2 commit 69ea3a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/uosc/lib/menus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ function open_command_menu(data, opts)
---@diagnostic disable-next-line: deprecated
mp.commandv(unpack(itable_join({'script-message-to'}, menu.root.callback, {utils.format_json(event)})))
elseif event.type == 'activate' then
-- Modifiers and actions are not available on basic non-callback mode menus
if not event.modifiers and not event.action then
-- Modifiers and actions are not available on basic non-callback mode menus.
-- `alt` modifier should activate without closing the menu.
if (event.modifiers == 'alt' or not event.modifiers) and not event.action then
run_command(event.value)
end
-- Convention: Only pure item activations should close the menu.
Expand Down

0 comments on commit 69ea3a2

Please sign in to comment.