diff options
| author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2026-01-18 23:51:28 -0800 |
|---|---|---|
| committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2026-01-18 23:51:28 -0800 |
| commit | 0790f4366bcd46e21792ae233f1b1c6d29e7d150 (patch) | |
| tree | 94a61784d1a3b31094621d11b4cef6975061c3db /main.lua | |
| parent | 664da9e0dfec80dc1cb49d1a1ffa4efa5b948607 (diff) | |
| download | mpv-iptv-menu-0790f4366bcd46e21792ae233f1b1c6d29e7d150.tar.gz mpv-iptv-menu-0790f4366bcd46e21792ae233f1b1c6d29e7d150.tar.xz | |
prevent cursor hiding when hovering button
Diffstat (limited to 'main.lua')
| -rw-r--r-- | main.lua | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1277,6 +1277,10 @@ local function toggle_menu() set_key_bindings() end +mp.set_key_bindings({ + {'MBTN_LEFT', toggle_menu}, + {'MBTN_LEFT_DBL'}, +}, 'toggle_button', 'force') local mouse_pos_time local mouse_over_button_area = false local mouse_over_toggle_button = false @@ -1320,12 +1324,9 @@ mp.observe_property('mouse-pos', 'native', function(_, mpos) if is_over ~= mouse_over_toggle_button then mouse_over_toggle_button = is_over if mouse_over_toggle_button then - mp.add_forced_key_binding( - 'MBTN_LEFT', 'click', toggle_menu) - mp.add_forced_key_binding('MBTN_LEFT_DBL', 'click_dbl') + mp.enable_key_bindings('toggle_button') else - mp.remove_key_binding('click') - mp.remove_key_binding('click_dbl') + mp.disable_key_bindings('toggle_button') end end end) |
