Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Apple EarPods button doesn't pause/resume music #43

Closed
ertemplin opened this issue Feb 28, 2014 · 12 comments
Closed

Apple EarPods button doesn't pause/resume music #43

ertemplin opened this issue Feb 28, 2014 · 12 comments
Milestone

Comments

@ertemplin
Copy link

When I use the headphones that came with my iPhone to listen to music with this app and press the button, iTunes opens instead of the music being paused.

The behavior should be:
Single press: pause
Double press: next song
Triple press: previous song

@kbhomes I'll look at this over this weekend and see if it's easy to implement. If so, I'll send you a pull request.

@kbhomes
Copy link
Member

kbhomes commented Mar 1, 2014

Thanks for looking into it. Unfortunately I don't have access to EarPods and I haven't been able to find relevant information on how it works. Let me know if you find any details.

@ertemplin
Copy link
Author

It looks like the headphone button presses are low level IOHIDDevice events. I think you have to look for devices that are buttons and then register for value change notifications. I'm relatively new to Apple's I/O kit, but I'll try to throw something together this week that can do this.

@microadam
Copy link

Same thing happens with bluetooth headphones. The media keys control iTunes rather than Google Music

@kbhomes
Copy link
Member

kbhomes commented Mar 8, 2014

Unfortunately I don't have bluetooth headphones with media controls, or Apple EarPods, so I can't develop this myself. I'm keeping this issue open in case anybody who has these and can develop a solution can contribute a pull request.

@tsdavis216
Copy link

The same happens when trying to use an Apple remote. The controls open iTunes instead of controlling Google Music. I would assume this could probably be corrected in the same way as the Apple EarPods or Bluetooth headphones.

@rahatm1
Copy link
Contributor

rahatm1 commented Mar 15, 2014

Since Snow Leopard pressing the EarPod button starts up iTunes instead of allowing one to control an already running media app. A Remote Control Daemon checks for that and opens up iTunes. There is no easy or proper way to do this, that is, other than modifying the rcd binary. [https://github.com/thebitguru/play-button-itunes-patch] This is also the reason no other app such as VLC, Spotify etc have this functionality.
I have also looked into the DDHIDLib which would be required to implement something like this after modifying the rcd binary but for me it only detected volume keys but not button presses.
So, I guess, its a won't fix unless someone takes the hack route.

@tsdavis216
Copy link

After digging a bit, I did see that the G-ear app accomplishes this by using a preference pane called Magic Keys that routes the button presses to the app. So it looks like you are correct, it may not be possible.

@se-bastiaan
Copy link

Repo for Magic Keys: https://github.com/zsoltt/MagicKeys, maybe that helps.

@kbhomes kbhomes added this to the v1.1.5 milestone May 29, 2014
@ebramanti
Copy link
Contributor

@se-bastiaan I tried Magic Keys, it lets me open Radiant if closed from remote on headphones but not pause/play.

@kbhomes kbhomes modified the milestone: v1.2.1 Sep 17, 2014
@afunix
Copy link

afunix commented Dec 11, 2014

There is an app to fix bluetooth play/pause/next/prev issues for Spotify: https://github.com/jguice/mac-bt-headset-fix

@mattnewham
Copy link

For anyone interested, whilst not a fix this can be implemented (at least with wired headphone buttons) using controllermate as described here:

http://apple.stackexchange.com/questions/52353/headphone-play-pause-button-controls-itunes-only

Create a new controllermate profile thing, press your button of choice and drag the controller onto the page.

Change the applescripts to reference Radiant Player rather than spotify, and also modify the "previous track" to "back track" (that stumped me for an hour or so before reading the cocoa definition file thingie)

@ebramanti
Copy link
Contributor

@afunix This works great for my needs! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants