jguice / mac-bt-headset-fix

Small mac application that fixes broken bluetooth headset control by listening for events and sending them directly to apps
488 stars 19 forks source link

Broken with 1.0.1.811.g63b21681 #17

Closed robbiet480 closed 9 years ago

robbiet480 commented 9 years ago

Using the latest Spotify open beta, the app no longer works. You can try out the beta here. Don't worry, you can have both installed side by side without any extra work.

I'll try to fix this in the next few days.

jguice commented 9 years ago

Ah, awesome. Thanks for the help! I can take a look this weekend :)

robbiet480 commented 9 years ago

Ok, well I found the issue at least, no idea how to fix it.

Upon starting Spotify Bluetooth Headset Listener, this line is output in my console: 1/12/15 16:41:35.590 Spotify Bluetooth Headset Listener[93073]: warning: failed to get scripting definition from /Applications/Spotify.app; it may not be scriptable.

I re-installed the Spotify non-beta version, and found that it had scripting definitions, whereas the beta had no scripting definitions at all. The non-beta version worked fine.

So I guess we need to find a new way to trigger commands and/or wait to see if Spotify re-adds AppleScript support. I would think they will, because there are a few other apps that use AppleScript to control Spotify. They do say "Please keep in mind that this is very much a Beta and not all features have been added yet, so you might find a few things missing." so that gives me hope.

The only other interesting note is that when hitting any built-in keyboard shortcuts for media, there are "key codes" (don't know what they are really called) output into Console. I've seen NX_KEYTYPE_PLAY, NX_KEYTYPE_REWIND, NX_KEYTYPE_FASTFORWARD

jguice commented 9 years ago

Oh. Hopefully that is just an omission from the beta bulid. ;)

If not then I guess it's time to do that rewrite I've been planning where I just re-fire the proper media key codes (still don't understand why the apple bluetooth stack doesn't do this).

robbiet480 commented 9 years ago

I submitted some feedback to them in the beta app asking to re-add AppleScript support. We'll see what happens.

johnelse commented 9 years ago

Hello, sorry to butt in, but I came across this issue while searching for information about the same problem. You may be interested in this workaround, which seems to get all the AppleScript commands other than play track working again.

Fortunately it looks like AppleScript support was broken by mistake rather than purposefully removed :)

jguice commented 9 years ago

Thanks! :)

jguice commented 9 years ago

Hi, I've updated the app to fire media key events (which should bypass the applescript problem). Give it a shot and let me know! https://s3-us-west-2.amazonaws.com/jguice/mac-bt-headset-fix-beta/Spotify+Bluetooth+Headset+Listener.zip

robnasby commented 9 years ago

Works great for me. Thanks for updating!!

jguice commented 9 years ago

Cool. Thanks for testing!

robbiet480 commented 9 years ago

Maybe too late now, but I also haven't had issues!

jguice commented 9 years ago

Hi, FYI I changed the next/prev ff/rw button mappings in the latest build. This seems to map best to most headphone button functions. :)