geekhack

geekhack Community => Keyboards => Topic started by: Pyrolistical on Fri, 13 January 2012, 04:38:18

Title: Code to get Mac OS X Media keys working?
Post by: Pyrolistical on Fri, 13 January 2012, 04:38:18
Has anybody been successful in creating a custom Mac keyboard where the media keys work?

And when I say media keys I exclude the volume control, as they are just normal scan codes.

The functions in question are:
F1 decrease display brightness
F2 increase display brightness
F3 Expose
F4 Gadgets
F5 decrease keyboard backlight
F6 increase keyboard backlight
Fn + "backspace" is "delete"
Fn + Left Arrow is Home
Fn + Up Arrow is Page Up
Fn + Right Arrow is End
Fn + Down Arrow is Page Down

I know the rest are not just scan code and requires kext to enable them, but has anybody been able to do that?  Did it just pretend to be an Apple keyboard to enable the AppleUSBTCKeyboard.kext?

Are there any non Apple keyboard out there that have successfully implemented this in a commercial product?
Title: Code to get Mac OS X Media keys working?
Post by: canthonytucci on Sat, 14 January 2012, 07:15:12
Have you tried keyremapformacbook ? I will take a look today and see if I cant get it working.
Title: Code to get Mac OS X Media keys working?
Post by: canthonytucci on Sat, 14 January 2012, 11:56:32
I got expose (well, mission control at least, I am running Lion) and dashboard widgets to work just using the built in Keyboard Shortcuts preference pane. I was able to map them to function keys and activate them on my HHKB, did not try with any other boards. I tried mapping a range of keys to brightness up/down but none would have any effect on my apple external monitor (while the apple aluminium keyboard changes screen brightness on this one just fine) there is a cat sleeping on top of the laptop right now who does not like to be moved, so I cant check if it does it on the internal screen, but when he moves I can try.

a very expensive cat bed indeed, I think he likes it because it is warm.
Title: Code to get Mac OS X Media keys working?
Post by: Pyrolistical on Sun, 15 January 2012, 12:07:34
That's a great idea.  I think that should work for all cases
Title: Code to get Mac OS X Media keys working?
Post by: wasdkeyboards on Mon, 16 January 2012, 18:32:21
A customer of mine remapped a his keyboard with Keyremapformacbook Link (http://www.clingmarks.com/custom-mac-mechanical-keyboard-lets-have-some-fun/893)

Scroll all the way down for the script he used.
Title: Code to get Mac OS X Media keys working?
Post by: SmallFry on Mon, 16 January 2012, 19:05:42
This got me excited... However, when I put the script into Keyremapformacbook, it did not preform...Is this because of my mac being an iMac or because the script is not what I was expecting?
Title: Code to get Mac OS X Media keys working?
Post by: Architect on Mon, 16 January 2012, 19:27:16
TrulyErgonomic keyboards support them, well not all, for some reason only the higher ones seems to work. At any rate check out the key codes at the end of the manual (http://www.trulyergonomic.com/TrulyErgonomic-Installation_QuickStartGuide.pdf)
Title: Code to get Mac OS X Media keys working?
Post by: SmallFry on Tue, 17 January 2012, 14:14:46
I got it to work on my Mac (Snow Leopard 10.6.8; there is separate Lion settings). I also made it so that the Apple Bluetooth Keyboard would not be affected.
I did so with these settings:
[ATTACH=CONFIG]37807[/ATTACH]
You also need to go into the Keyboard section of your system settings and set this:
[ATTACH=CONFIG]37809[/ATTACH]
^^^ALL OF THIS ABOVE IS REQUIRED TO GET THE MEDIA KEYS JUST LIKE THE APPLE BLUETOOTH KEYBOARD^^^
Also, just to be a bit more like a regular keyboard I swapped the USB Keyboard Modifiers like this(NOT Necessary to get the Media Keys):
[ATTACH=CONFIG]37810[/ATTACH]
Have fun with it. Finally, if anyone gets their Eject key bound to Pause/Break please tell me how.
Title: Re: Code to get Mac OS X Media keys working?
Post by: Yeitso on Thu, 05 March 2015, 02:56:09
with this ive been able to fix media keys :)

https://gist.github.com/NoobsArePeople2/5121597
Title: Re: Code to get Mac OS X Media keys working?
Post by: KHAANNN on Thu, 05 March 2015, 15:33:52
with this ive been able to fix media keys :)

https://gist.github.com/NoobsArePeople2/5121597
You can also do these without any software overriders

You can create them from the Automator as Service's, then add shortcuts to those Service's

On the other hand I'm very tempted to just use Karabiner and get it over with, but I'm against utilities/programs that require admin permissions / modify the system, although Karabiner seems very very very solid, also it's open source, I'm very tempted ...