sonixd icon indicating copy to clipboard operation
sonixd copied to clipboard

Media hotkeys do not work on MacOS

Open xkevinx opened this issue 1 year ago • 12 comments

Describe the bug

I made sure Sonixd was a trusted accessibility client, but so far the media hotkeys do not work on my Macbook.

When I press the play/pause key, it opens Apple music or starts playing something I was playing before on my browser, but it never plays or pause anything on Sonixd.

To Reproduce Steps to reproduce the behavior:

  1. Play some music on Sonixd
  2. Press the play/pause media hotkey
  3. Nothing happens

Expected behavior Music should pause

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS 12.5

Additional context Nothing to add but I wanted to thank you for this cool app!

xkevinx avatar Aug 25 '22 13:08 xkevinx

I am not sure if this will help, but I have noticed that if I turn off my bluetooth speakers, any music player would be paused by the system, but not sonixd. Perhaps what I'm going to say is total BS, but could it be that the player is not considered as a media or something?

xkevinx avatar Aug 25 '22 15:08 xkevinx

Have you already added Sonixd as a trusted accessibility client? I've previously heard of some unresolved issues with bluetooth audio but media keys should work after adding it there.

jeffvli avatar Aug 29 '22 02:08 jeffvli

Yes I do! So I have tried using the media hotkeys along the day today on my work computer, I managed to have them work a few times (around 10-20% of the times I tried) but most of the times they didn't work. There's definitely an issue there because I don't have any problem with other music apps.

xkevinx avatar Aug 30 '22 14:08 xkevinx

Remove sonixd from accessibility agents and re-add it (or just add it manually).

pztrn avatar Aug 31 '22 10:08 pztrn

no sorry, it is not changing anything. Since the problem seems to be hard to replicate I'm fine with closing the issue, I can live without the media keys :)

xkevinx avatar Sep 01 '22 10:09 xkevinx

Probably stupid question, yet:

Is "Global Media Hotkeys" enabled in settings - player?

pztrn avatar Sep 01 '22 12:09 pztrn

I'm not the OP, but this was not a stupid question for me. :) I had reinstalled Sonixd. I knew enough to make sure it was trusted, but forgot that I had to toggle the setting. Thanks.

bit101 avatar Sep 01 '22 13:09 bit101

ahah yes could have happened to me but the setting was toggled already

xkevinx avatar Sep 01 '22 14:09 xkevinx

oh, I read the initial description in more detail. This is a Mac OS "feature". I installed notunes which "fixes" this feature. https://github.com/tombonez/noTunes

bit101 avatar Sep 01 '22 14:09 bit101

@bit101 thanks for the advice! It does stop Apple Music to start when using the hotkeys, but they are still not doing any effect on Sonixd

xkevinx avatar Sep 03 '22 02:09 xkevinx

ok I fixed it after digging a bit more online!

I went to Settings -> Accessibility -> Keyboard and I turned on enable full keyboard access and restarted the laptop. It looks all good now!

[edit] I was getting annoyed with enable full keyboard access because the space bar was triggering some stuffs... So I deactivated it but the media hotkeys are still working. I really don't understand but problem solved!

xkevinx avatar Sep 03 '22 04:09 xkevinx

No solutions here worked for me except notunes, which suggests - to me - this is more of an overzealous Apple issue than a Sonixd one

How do everyone else's media keys behave with other apps (e.g. correctly/incorrectly)?

Hope this helps

ldexterldesign avatar Mar 11 '23 01:03 ldexterldesign