klj
This commit is contained in:
@@ -5993,16 +5993,23 @@ mp.add_timeout(0, function()
|
||||
_lua_log('lyric-helper auto-start raised: ' .. tostring(lyric_err))
|
||||
end
|
||||
|
||||
-- Try to re-register right-click after UOSC loads (might override its binding)
|
||||
mp.add_timeout(1.0, function()
|
||||
_lua_log('[KEY] attempting to re-register mbtn_right after UOSC loaded')
|
||||
pcall(function()
|
||||
mp.add_key_binding("mbtn_right", "medios-menu-right-click-late", function()
|
||||
_lua_log('[KEY] mbtn_right pressed (late registration attempt)')
|
||||
-- Force-claim mbtn_right so the Medios menu fires reliably regardless of
|
||||
-- whether uosc has a cursor zone active at the click position.
|
||||
-- mp.add_forced_key_binding has higher priority than uosc's force-group.
|
||||
-- Use complex=true to get the event type and fire only on button release.
|
||||
local ok_rclick, rclick_err = pcall(function()
|
||||
mp.add_forced_key_binding('mbtn_right', 'medios-mbtn-right-forced', function(e)
|
||||
if e and e.event == 'up' then
|
||||
_lua_log('[KEY] mbtn_right up -> show_menu')
|
||||
M.show_menu()
|
||||
end, {repeatable=false})
|
||||
end)
|
||||
end
|
||||
end, {complex = true, repeatable = false})
|
||||
end)
|
||||
if ok_rclick then
|
||||
_lua_log('[KEY] registered forced mbtn_right binding')
|
||||
else
|
||||
_lua_log('[KEY] forced mbtn_right failed: ' .. tostring(rclick_err) .. ' (falling back to input.conf)')
|
||||
end
|
||||
end)
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user