evafast icon indicating copy to clipboard operation
evafast copied to clipboard

Add keybind to right click hold

Open Zabooby opened this issue 2 years ago • 6 comments

Would it be possible to add a keybind to right click hold, basically how YouTube implemented it? It would be useful when someone does not have easy access to their keyboard.

Zabooby avatar Jan 28 '24 17:01 Zabooby

Yeah I want to do it eventually.

po5 avatar Jan 28 '24 17:01 po5

Would it be possible to add a keybind to right click hold, basically how YouTube implemented it? It would be useful when someone does not have easy access to their keyboard.

If you're on windows, you can use a program called AutoHotKey with my script and get what you need. Save the script as whatever name you want to with a (.ahk) at the end and run it, now when you're using MPV and you hold the right mouse button down, it will simulate holding the right arrow key down physically and will keep fast forwarding, when you let go of the right mouse button physically, it will stop fast forwarding.

#IfWinActive ahk_exe mpv.exe

RButton::
    ; Send the right arrow key down
    Send {Right down}
    ; Set a flag to indicate that the right arrow key is being held down
    KeyDownFlag := true
return

RButton Up::
    ; Release the right arrow key
    Send {Right up}
    ; Reset the flag since the key is no longer held down
    KeyDownFlag := false
return

; Check if the right arrow key is still being held down at regular intervals (e.g., every 50 milliseconds)
SetTimer, CheckKeyState, 50
return

CheckKeyState:
    ; If the right mouse button is no longer held down, release the right arrow key
    if (!GetKeyState("RButton", "P") and KeyDownFlag) {
        Send {Right up}
        KeyDownFlag := false
    }
return

#If

AziRizvi avatar Feb 18 '24 15:02 AziRizvi

https://github.com/jgreco/mpv-scripts/blob/master/fastforward.lua

e788b1 avatar Apr 03 '24 21:04 e788b1

If you're on windows, you can use a program called AutoHotKey with my script and get what you need. Save the script as whatever name you want to with a (.ahk) at the end and run it, now when you're using MPV and you hold the right mouse button down, it will simulate holding the right arrow key down physically and will keep fast forwarding, when you let go of the right mouse button physically, it will stop fast forwarding.

I'm not too keen on having to install another program just for this one feature.

https://github.com/jgreco/mpv-scripts/blob/master/fastforward.lua

I think I like evafast's implementation more.

Zabooby avatar Apr 04 '24 06:04 Zabooby

I found my own solution by using the input event script.

Zabooby avatar Apr 09 '24 08:04 Zabooby

This is still something I'd like to support natively.

po5 avatar Apr 09 '24 17:04 po5