cyl0 / ModernX

A modern OSC UI replacement for MPV that retains the functionality of the default OSC.
545 stars 28 forks source link

How can I assign the 'DEL' key to show OSC? #31

Closed emk2203 closed 1 year ago

emk2203 commented 1 year ago

With the default configuration of mpv, the DEL key toggles between the auto, always-on and always-off states of the OSC.

Is there a way to make the DEL key work with MordenX so this behavior is replicated (or just that the OSC can be shown)? I use this in a HTPC setting with a IR remote, mouse hovering is unfortunately not an option.

I know it works just when pausing the video, but sometimes I want to see how much time is left without pausing, just with a discreet glance at the OSC.

mhyee commented 1 year ago

Try adding this to your input.conf:

DEL script-binding modernx/visibility

The "auto" and "always-on" seems to work for me, but "always-off" gets reset to "always-on" whenever I pause/unpause.

emk2203 commented 1 year ago

I got an answer from the original author (this here is a fork), who advised to

first add this line to the end of modern.lua file mp.add_key_binding(nil, 'show_osc', function() show_osc() end)

then add this line to your input.conf file DEL script-binding show_osc

which works very well for me. I cross-post it here to maybe help others with the same interest.