Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keybind to right click hold #14

Open
Zabooby opened this issue Jan 28, 2024 · 6 comments
Open

Add keybind to right click hold #14

Zabooby opened this issue Jan 28, 2024 · 6 comments

Comments

@Zabooby
Copy link

Zabooby commented Jan 28, 2024

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.

@po5
Copy link
Owner

po5 commented Jan 28, 2024

Yeah I want to do it eventually.

@AziRizvi
Copy link

AziRizvi commented Feb 18, 2024

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

@e788b1
Copy link

e788b1 commented Apr 3, 2024

@Zabooby
Copy link
Author

Zabooby commented Apr 4, 2024

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
Copy link
Author

Zabooby commented Apr 9, 2024

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

@Zabooby Zabooby closed this as completed Apr 9, 2024
@po5
Copy link
Owner

po5 commented Apr 9, 2024

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

@po5 po5 reopened this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants