-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Media control Shortcuts #1824
Comments
Just to test, this works: diff --git a/app/src/event_converter.c b/app/src/event_converter.c
index ab48898d..dc88c239 100644
--- a/app/src/event_converter.c
+++ b/app/src/event_converter.c
@@ -96,6 +96,9 @@ convert_keycode(SDL_Keycode from, enum android_keycode *to, uint16_t mod,
MAP(SDLK_RCTRL, AKEYCODE_CTRL_RIGHT);
MAP(SDLK_LSHIFT, AKEYCODE_SHIFT_LEFT);
MAP(SDLK_RSHIFT, AKEYCODE_SHIFT_RIGHT);
+ MAP(SDLK_F9, AKEYCODE_MEDIA_PLAY_PAUSE);
+ MAP(SDLK_F10, AKEYCODE_MEDIA_REWIND);
+ MAP(SDLK_F11, AKEYCODE_MEDIA_FAST_FORWARD);
}
if (!(mod & (KMOD_NUM | KMOD_SHIFT))) { But there is no customizable mapping on scrcpy (and media keys are not correctly received by SDL, for example I never receive |
How to use this ? click on F9, F10 and f11 ? Doesn't seems to works for me. |
Does it work for you:
? On some laptops, Fn is "enabled" by default (customizable from BIOS/UEFI), so you need to press Fn+F9. |
Running this works for me. Music paused and played And I disabled Fn a while back on my laptop, as I am using F2 very frequently for renaming, so this is not the problem for me I |
@hafizidev How did you compiled scrcpy including this patch? |
I am very sorry, I didn't notice that this is development feature. I use the release version, not development, no wonder it didn't work. Sorry again |
What about next track or previous track |
Checkout Android Key Events docs: |
maybe related: #4080 Background, why this might be not enough on linux systems: On most Desktop environments, the wayland shell/Xwindow manager will receive these button events and handle them theirselves. For sharing actions with the actual applications, so that they can respond to these actions, these applications implement dbus MPRIS. I'm currently looking at an implementation for mpv which looks quite minimal (as minimal as it gets with dbus...) to maybe port this over to scrcpy. |
I have been using vysor to control my FireTV devices and since they upgraded to v3 it's been a complete cluster****. Found your tool yesterday and it does 99% of everything I need and it is GREAT!
There is one issue/request. Can you add media control shortcuts? Specifically to rewind, play/pause, forward media. For the FireTV the keycodes are:
KEYCODE_MEDIA_PLAY_PAUSE
KEYCODE_MEDIA_REWIND
KEYCODE_MEDIA_FAST_FORWARD
In vysor, I modify the settings so that my current laptop buttons for these 'functions' is linked to the keycode (currently F9, F10 and F11 buttons).
It would be great to add shortcuts that would pass those keycodes so that it is possible to control media play through scrcpy.
FYI, I am not a programmer and I don't know the complexity of this request. Best, MonDV (Thanks for the great tool!!!)
The text was updated successfully, but these errors were encountered: