nuclear icon indicating copy to clipboard operation
nuclear copied to clipboard

Global next/previous track shortcuts

Open MoonlitMonitor opened this issue 1 year ago • 4 comments

One of my extra mouse buttons is mapped to play/pause. Whether or not I have Nuclear in focus, that mouse button can be used to play/pause in Nuclear, unless I have other sources playing in other programs.

However, two of the other extra mouse buttons are mapped to 'next track' and 'previous track', but I can only use these on Nuclear when the application is in focus.

It would be helpful if I could go to the next/previous track without having Nuclear in focus.

OS: Windows 11

MoonlitMonitor avatar May 11 '24 17:05 MoonlitMonitor

There's a method to do this but there's a caveat to making it multiplatform: https://www.electronjs.org/docs/latest/api/global-shortcut#globalshortcutregisteraccelerator-callback

The following accelerators will not be registered successfully on macOS 10.14 Mojave unless the app has been authorized as a trusted accessibility client:

"Media Play/Pause" "Media Next Track" "Media Previous Track" "Media Stop"

nukeop avatar May 11 '24 23:05 nukeop

There's a method to do this but there's a caveat to making it multiplatform: https://www.electronjs.org/docs/latest/api/global-shortcut#globalshortcutregisteraccelerator-callback

The following accelerators will not be registered successfully on macOS 10.14 Mojave unless the app has been authorized as a trusted accessibility client:

"Media Play/Pause" "Media Next Track" "Media Previous Track" "Media Stop"

If I understood correctly, this doesn't seem to be a problem on Windows or Linux, but on macOS users would have to authorize the application by allowing it to use special permissions? If so, is that a security concern that would stop you from adding this feature?

MoonlitMonitor avatar May 15 '24 15:05 MoonlitMonitor

There are no security concerns here. If anyone wants to contribute this feature I'll be glad to merge it.

nukeop avatar May 15 '24 17:05 nukeop

Linux playerctl also lacks the ability to skip songs

Packjackisback avatar May 28 '24 19:05 Packjackisback