-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 Key support on Windows #56
Comments
Edit 10/21/23: repurposing this issue for Windows media key integration since that's the last platform left Media key support will need to be implemented using the media APIs of each platform. Tracking the completion of each platorm here:
Old invalid info, for historical context
|
i think you need MPRIS https://wiki.archlinux.org/title/MPRIS at least on linux |
Related: #75 |
This is heavily platform dependent. Unix-like systems that implement free desktop standards like D-Bus (this would exclude MacOS) handle media keys through MPRIS. This also provides media controls for desktop environments like Gnome. I doubt there is a clean way to make this feature cross-platform without implementing a solution for each platform separately. |
MPRIS working great on linux (arch). Great work! |
I'm struggling to get the media keys to work on Linux with a flatpak install. I think the permissions are off, but I'm not sure. Its currently listed as owning "org.mpris.MediaPlayer2.Supersonic". I think the ID is "dweymouth.supersonic", so maybe it should match? |
You may need to force-update the Flatpak. There was a recently fixed issue with Flatpak MPRIS permissions and the Flatpak manifest was updated but the app version number has not been bumped. See #226 |
That worked great, thanks! |
Hey, how's progress going on the Windows Media Key support? Reckon we might see it in 0.90? 🙏 Love your work @dweymouth |
Maybe.. definitely if you know anyone who knows WinAPI C/C++ development and can refer them over here :) Mac media key support was contributed by someone familiar with MacOS dev |
Did a little more digging, and it seems like it may be difficult to get this working on Windows. See this issue here for discussion - but it seems the SystemMediaTransportControls APIs are a bit problematic to use for non-UWP apps, and especially apps built with a cross platform toolkit that never exposes a HWND directly. |
Thanks for the update @dweymouth fingers crossed they eventually make it easier to include windows media key integration. Still loving Supersonic. |
Hmm, it seems like we could adapt Tauon Music Box's idea to access these APIs: Taiko2k/Tauon@6742576#diff-6b63f857d89b9e3a0dbd1cc014f89df23bf20d881fa07638c382044f6c73bf08 They compile a DLL that creates a dummy hidden application window so it can have access to those APIs. Maybe someone with more Win32 dev experience could give this approach a try |
For those of us on windows this AutoHotKey script will enable play/pause functionality while we wait for an update: Media_Play_Pause::
WinGet, targetWindow, ID, ahk_exe Supersonic.exe
if (targetWindow) {
ControlSend,, {Space}, ahk_id %targetWindow%
}
else {
Run, "C:\Program Files\SuperSonic\Supersonic.exe"
WinWait, ahk_exe Supersonic.exe,, 10
WinGet, TargetWindow, ID, ahk_exe Supersonic.exe
if (TargetWindow) {
ControlSend,, {Space}, ahk_id %TargetWindow%
WinClose, ahk_id %TargetWindow%
; WinMinimize, ahk_id %TargetWindow%
; This assumes that you've set your window to close to the system tray, move the comment ";" to the WinClose line if that is not the case.
}
}
return |
Are you planning on adding media key support?
The text was updated successfully, but these errors were encountered: