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

Undo screensaver with volume keys #1

Open
Obegg opened this issue Oct 23, 2022 · 8 comments
Open

Undo screensaver with volume keys #1

Obegg opened this issue Oct 23, 2022 · 8 comments

Comments

@Obegg
Copy link

Obegg commented Oct 23, 2022

I want to be able to undo the black screensaver with my volume keys the same way the script detects that I move my cursor

@Akemi
Copy link
Owner

Akemi commented Oct 23, 2022

are those keys even recognised by mpv or are those global multimedia keys? you can test with mpv --input-test --force-window --idle. if it's the latter, and the keys are not recognised by mpv, it's not possible.

@Akemi
Copy link
Owner

Akemi commented Oct 23, 2022

should any other keys also remove the screensaver? like all the keys that change brightness, colour, etc? should it be done on any key press?

@Obegg
Copy link
Author

Obegg commented Oct 23, 2022

are those keys even recognised by mpv or are those global multimedia keys? you can test with mpv --input-test --force-window --idle. if it's the latter, and the keys are not recognised by mpv, it's not possible.

recognized by mpv? what does it mean? pretty confusing wording but I use this:

UP	 	add volume +1
DOWN 		add volume -1
WHEEL_UP	add volume +1
WHEEL_DOWN	add volume -1

I hope it answers your question

should any other keys also remove the screensaver? like all the keys that change brightness, colour, etc? should it be done on any key press?

Uh, I didn't think of that to be honest, that's a great idea (even tho I removed any keys that change those things, so it's pretty useless to me)

@Akemi
Copy link
Owner

Akemi commented Oct 23, 2022

yeah that answers the question. though this might not be possible if not catching or reacting on all key presses. first of all, mpv doesn't have an api that can tell the script which key is bound to which function. in that case one can only react on the default key binding, which wouldn't help your case.

the second limitation, i believe mpv's scripting api doesn't have a keybinding chaining mechanism. so one keybinding can only have one function bound to it. if i want to react on WHEEL_UP i would overwrite your binding instead.

i believe this can't be implemented in a satisfactory way atm.

@Obegg
Copy link
Author

Obegg commented Oct 23, 2022

What about your suggestion?

should it be done on any key press?

If it detects any key press (regardless of keybinding) = undo screensaver

@Akemi
Copy link
Owner

Akemi commented Oct 24, 2022

same, one would need to override any keybinding.

@Obegg
Copy link
Author

Obegg commented Oct 24, 2022

Should I close this issue or keep it open?

@Akemi
Copy link
Owner

Akemi commented Oct 24, 2022

keep it open for now, i will look into it when i have some free time and maybe we can work around the limitation.

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

2 participants