natural-harmonia-gropius / input-event

InputEvent.lua for mpv-player, enhanced input.conf with better, conflict-free, low-latency event mechanism.
MIT License
39 stars 5 forks source link

Weird behavior with `#@press` when triggering another command at the same time #33

Closed xfzv closed 1 year ago

xfzv commented 1 year ago

I have the following in input.conf:

s      script-binding uosc/subtitles    #! Subtitles
TAB    script-binding uosc/toggle-ui    #@press
TAB    script-binding uosc/toggle-ui    #@release

If I keep pressing TAB and then press s (without releasing TAB), then press either s again or ESC to close uosc/subtitles window and finally release TAB, then everything is inverted: uosc ui is permanently displayed and is hidden if I keep TAB pressed.

Expected behavior in this case: when releasing TAB, uosc UI isn't displayed because TAB isn't pressed.

It also occurs when triggering other commands like script-binding quality_menu/audio_formats_toggle or script-binding quality_menu/video_formats_toggle.

Video of the issue, although the keys I'm pressing aren't displayed on the screen so it's not very useful:

https://user-images.githubusercontent.com/78810647/212176370-98c5a729-16c5-450c-bfbb-63d016009db1.mp4

Thoughts?

natural-harmonia-gropius commented 1 year ago

Use set-min-visibility instead to toggle-ui. https://github.com/tomasklaen/uosc/issues/317

script-message-to uosc set-min-visibility 1 #@press
script-message-to uosc set-min-visibility 0 #@release
xfzv commented 1 year ago

Thank you, this works as expected.