Author Topic: Ergodox and media keys with Spotify  (Read 3192 times)

0 Members and 1 Guest are viewing this topic.

Offline cruzin

  • Thread Starter
  • Posts: 88
  • Location: Texas
Ergodox and media keys with Spotify
« on: Mon, 06 October 2014, 01:39:45 »
So I finally figured out how to compile the firmware from source and make my own layout with media keys like pause/play, prev/next. All of those work for iTunes (I'm on a Mac), but only pause/play works with Spotify. Is this happening for anyone else as well? Is there a trick to getting this to work?
Current: Ergodox (Ergo-clears) | Kinesis Advantage (Browns) -- Colemak
Future: HHKB Pro 2 | Maltron L90 | µtron | Axios

Offline nacitar

  • Posts: 27
Re: Ergodox and media keys with Spotify
« Reply #1 on: Mon, 06 October 2014, 10:46:44 »
I don't use spotify, but my media keys are working great everywhere I've tried.  I'm also the guy that fixed the media key support for the stock firmware on github.

It works for me on linux, on windows in media player/foobar2000/etc... and even works in youtube if it's focused.

Are you sure you set up the keys correctly?  You know in the firmware there's three tables.

1) the key/data table
2) the onPress function table
3) the onRelease function table

Media keys and normal typing keys use DIFFERENT press/release functions, if you changed the data only and not those functions this would explain your problem.

I'm betting the keys that are "working" for you were already media keys, and the ones that aren't working were normal typing keys you were converting over, but never updated the function tables.

Let me know if that guess is right.
« Last Edit: Mon, 06 October 2014, 10:48:40 by nacitar »

Offline cruzin

  • Thread Starter
  • Posts: 88
  • Location: Texas
Re: Ergodox and media keys with Spotify
« Reply #2 on: Mon, 06 October 2014, 10:59:36 »
I edited a base layout that was created with the MD config utility. In the file I added MEDIAKEY_PLAY_PAUSE, MEDIAKEY_NEXT_TRACK and MEDIAKEY_PREV_TRACK to the layout table.

#define mprrel   &kbfun_mediakey_press_release

was added to the definitions. I then switched kprrel to mprrel to the appropriate locations in the press/release tables. Is there something else I missed?
Current: Ergodox (Ergo-clears) | Kinesis Advantage (Browns) -- Colemak
Future: HHKB Pro 2 | Maltron L90 | µtron | Axios

Offline nacitar

  • Posts: 27
Re: Ergodox and media keys with Spotify
« Reply #3 on: Mon, 06 October 2014, 11:23:43 »
You're just using the layout from massdrop, right?  Not the rest of the code....

Massdrop's firmware is out of date, you need the github one.  I'm pretty sure that's what you implied, but I'm just wanting to be sure.

Also, if you can pastebin or attach your layout file(s) I can look at it.

Offline nacitar

  • Posts: 27
Re: Ergodox and media keys with Spotify
« Reply #4 on: Mon, 06 October 2014, 11:37:24 »
i just re-read your post... if they already worked in something else, honestly, I'd blame spotify.  If you have a firmware problem it shouldn't work anywhere.

Offline cruzin

  • Thread Starter
  • Posts: 88
  • Location: Texas
Re: Ergodox and media keys with Spotify
« Reply #5 on: Mon, 06 October 2014, 11:41:10 »
You're just using the layout from massdrop, right?  Not the rest of the code....

Massdrop's firmware is out of date, you need the github one.  I'm pretty sure that's what you implied, but I'm just wanting to be sure.

Also, if you can pastebin or attach your layout file(s) I can look at it.

Yes, just using the layout from MD, not the firmware. I've attached the layout file.

You mentioned that yours also works with YouTube. Mine does not. Are you on a Mac or PC? Edit: just saw you are on a PC in your earlier post.
« Last Edit: Mon, 06 October 2014, 11:44:06 by cruzin »
Current: Ergodox (Ergo-clears) | Kinesis Advantage (Browns) -- Colemak
Future: HHKB Pro 2 | Maltron L90 | µtron | Axios

Offline nacitar

  • Posts: 27
Re: Ergodox and media keys with Spotify
« Reply #6 on: Mon, 06 October 2014, 11:54:07 »
Looks fine to me.  I blame spotify.  Do you have another keyboard with media keys you can test spotify with?

Offline cruzin

  • Thread Starter
  • Posts: 88
  • Location: Texas
Re: Ergodox and media keys with Spotify
« Reply #7 on: Mon, 06 October 2014, 12:18:28 »
Tested with an Apple aluminum keyboard and all the media keys work with Spotify.
Current: Ergodox (Ergo-clears) | Kinesis Advantage (Browns) -- Colemak
Future: HHKB Pro 2 | Maltron L90 | µtron | Axios

Offline nacitar

  • Posts: 27
Re: Ergodox and media keys with Spotify
« Reply #8 on: Mon, 06 October 2014, 12:22:07 »
Do you have a non-apple keyboard to test with?  I'm betting they aren't using "standard" media key codes or something.

I also see this, https://gist.github.com/NoobsArePeople2/5121597

That seems to support this notion.

Apple keyboard media keys on mac will work, but now I suspect a standard windows keyboard's media keys wouldn't work in spotify on your mac.
« Last Edit: Mon, 06 October 2014, 12:23:49 by nacitar »

Offline cruzin

  • Thread Starter
  • Posts: 88
  • Location: Texas
Re: Ergodox and media keys with Spotify
« Reply #9 on: Mon, 06 October 2014, 12:39:33 »
I seem to remember my old KUL ES-87 being able to do this, but I'm not 100% on that. It had a Mac-mode through a DIP switch. I wish I still had it so I could test.

My Kinesis Advantage does not have media keys.
Current: Ergodox (Ergo-clears) | Kinesis Advantage (Browns) -- Colemak
Future: HHKB Pro 2 | Maltron L90 | µtron | Axios

Offline nacitar

  • Posts: 27
Re: Ergodox and media keys with Spotify
« Reply #10 on: Mon, 06 October 2014, 13:01:31 »
Well, it looks like the easy way would be to google "windows media keys on mac" or similar and use one of their hotkey-addition solutions out there...  The hard way would be figuring out how macs send their nonstandard media keys and to modify the firmware.

A perfunctory search isn't revealing how they send it over usb, either... maybe someone else here would know.
« Last Edit: Mon, 06 October 2014, 13:03:10 by nacitar »

Offline cruzin

  • Thread Starter
  • Posts: 88
  • Location: Texas
Re: Ergodox and media keys with Spotify
« Reply #11 on: Mon, 06 October 2014, 13:10:33 »
I'd prefer the second way, but I may resign to the first.
Current: Ergodox (Ergo-clears) | Kinesis Advantage (Browns) -- Colemak
Future: HHKB Pro 2 | Maltron L90 | µtron | Axios

Offline nacitar

  • Posts: 27
Re: Ergodox and media keys with Spotify
« Reply #12 on: Mon, 06 October 2014, 14:05:21 »
Well if you can dig up the USB specs for apple's media keys, be it from people here or from the web, myself or others might look into making such a change.  I just don't have the time to do such a search (my ~10min searching didn't find anything) atm.... and I also don't own any apple devices, so there's that.

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13560
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Ergodox and media keys with Spotify
« Reply #13 on: Mon, 06 October 2014, 14:46:13 »
Spotify and Netflix  are for n00bs..

Ergodox Users only cruise .Torrent !

Offline nacitar

  • Posts: 27

Offline BartVB

  • Posts: 25
Re: Ergodox and media keys with Spotify
« Reply #15 on: Tue, 07 October 2014, 05:20:01 »
Spotify on Mac is a bit weird when it comes to mediakeys. I'm currently using a TrulyErgonomic keyboard. They mediakeys on that board work with iTunes etc but not with SPotify with the exception of play/pause.

But good luck with getting this to work and please keep us posted! I still have two unassembled Ergodox boards in a cupboard somewhere. But it's going to be winter here soon, so more rainy sunday afternoons = more time for soldering :)