Arieleg / mpv-copyTime

Copy the current time of the video to clipboard.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to invoke function

Pysis868 opened this issue · comments

commented

Found that the hotkey binding does not work on my Win 10 system unless I add Ctrl+c script-binding copyTime to %AppData%\mpv\input.conf.

I know the script loads the functions because of the trace message I added at the bottom, and that the function also works because using tilde (~) I can execute the function explicitly using the console and this command: script-message copyTime.

I had installed mpv.net which seems to have added entries to that file, so I downloaded a fresh copy from https://github.com/mpv-player/mpv/raw/master/etc/input.conf.

I tried other hotkeys such as c, C, and Ctrl+C by duplicating the script's hotkey line at the end, but none of them work..

I do not have programs such as AutoHotKey running at the moment. I do have the PowerToys normal and Awake programs running, but should not interfere. I even tested with that component disabled, and encountered the same, negative result.
Don't think Steam interferes either, as it only provides desktop input configuration for controllers.

Otherwise this script works on my other machines with other OSs, and another Windows one, and I thought even this one before, where I've only installed controller drivers and AHK, so not sure what would break it..

I tried updating to mpv-x86_64-20220619-git-c1a46ec from https://sourceforge.net/projects/mpv-player-windows/files/ and my old version 0.33 I think, but thta did not help either.

mp.add_key_binding("Ctrl+C", "copyTime", copyTime)
mp.add_key_binding("Ctrl+c", "copyTime", copyTime)
mp.add_key_binding("c", "copyTime", copyTime)
mp.add_key_binding("C", "copyTime", copyTime)
mp.osd_message("script end copyTime")
> mpv --input-test --force-window --idle
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
[copyTime] No supported clipboard command found
[input] Key c is bound to:
[input] (nothing)
[input] Key C is bound to:
[input] 1.  'script-binding copyTime/copyTime' in section {input_copyTime} in <api>:1 (default)
[input] Key Ctrl+c is bound to:
[input] 1.  'quit 4' in <builtin>:1 (default)
[input] Key Ctrl+C is bound to:
[input] (nothing)

The program stays open when I press that combination, as you can see continued message output.

Now seeing in my %AppData%\mpv\mpv.conf, commenting a line to #input-default-bindings = no improved my bindings in general, made Ctrl+c quit the program, and now only C works to copy the time..

Adding Ctrl+c ignore to input.conf at least stops the quit functionality..

Thanks so much! Adding that line to input.conf got it working for me too.