10

Is there a software, command or way to know what keys from an external non apple keyboard are being mapped to which mac keys?
And also is there a way to remap the shortcut keys of my keyboard: back, forward, home, search & mail?
The play and volume keys on my keyboard do work as expected, but the other keys don't seem to de anything.

PS: I have this one: enter image description here

2
  • To be clear, are you referring only to function keys and modifier keys?
    – Austin
    Commented May 11, 2011 at 17:54
  • I figured out that print screen, scroll lock and pause map to F13 - F15, so the only useless keys there are left are the shortcut keys, i.e. navigation, mail, etc.
    – Petruza
    Commented May 12, 2011 at 15:19

3 Answers 3

7

ControllerMate does this. At work I use the Microsoft Natural ergonomic keyboard and a Logitech mouse. ControllerMate has hardware profiles for both, and I have many of the MS-specific keys remapped to other functions.

Like yours, my keyboard also has an otherwise useless Mail button. With Controllermate open, if I press the Mail button while viewing the Microsoft keyboard profile, the list of available key sequences automatically jumps to the one it just received. You can then program that key to do whatever you like, even when ControllerMate isn't open.

enter image description here

5
  • even when ControllerMate isn't open so they key mapping must be in a configuraion file of some kind right? do you know which one or if there is one at all?
    – Petruza
    Commented May 12, 2011 at 15:18
  • ControllerMate has a small-footprint helper app running in the background at all times, presumably monitoring I/O. The app is closed, but the helper app remains running. Commented May 12, 2011 at 17:14
  • oh ok [padding...]
    – Petruza
    Commented May 13, 2011 at 16:38
  • +1 I believe this is the best way to do it -- I was just trying to provide more information for the OP in my answer and didn't mean for it to become the "accepted" answer. :/
    – Austin
    Commented May 13, 2011 at 17:00
  • you're right. fixed.
    – Petruza
    Commented May 14, 2011 at 13:08
4

I think the answer about ControllerMate is a good one, but since you asked in a comment about a configuration file, I'll mention that the most powerful, "raw" way to configure your keyboard settings is by creating a custom keyboard layout. I would guess that this is how apps like ControllerMate modify keyboard keys, but I can't say that for sure.

You can use an online generator for this purpose (it's old, but the .keylayout files it generates still work under Snow Leopard) or a GUI like Ukelele (free).

When doing it this way, you would add the resulting .keylayout XML file to /Library/Keyboard Layouts (for use by all users) or ~/Library/Keyboard Layouts (for use by only the current user). Then you would enable the custom layout in System Preferences -> Language & Text -> Input Sources.

For your third-party keyboard, it would still be tricky to find out the key code in a given mapSet for those "useless" keys for "Back", "Forward", "Mail", etc. Personally, I would go with a GUI program that allows me to "press and set" so there's no extra research or guesswork on my part.

So in short, I am not saying that this method is easier or even more powerful than using an app like ControllerMate, but it should at least help explain how keyboards can be re-mapped under OS X without a "middleman" program that has to stay running in the background.

2
  • Thanks! I actually use a keylayout I made with ukelele, and tried the shortcut keys but ukelele doesn't seem to notice them at all. What do you mean by mapSet ?
    – Petruza
    Commented May 13, 2011 at 16:42
  • A mapSet "maps" virtual codes to each keypress so they can be assigned to a character in the .keylayout XML file. I don't believe any of the virtual keyboard layouts in Ukelele will have virtual buttons to match those extra Microsoft keyboard keys at the top, so it might not be possible in that program. ... Have you tried ControllerMate? It seems to do exactly what you want -- you press a "strange" key on your keyboard, and it lets you assign it to whatever you want.
    – Austin
    Commented May 13, 2011 at 17:00
3

I know this is an old question, but future generations might like to know about a more recent tool. It's called Karabiner and can remap tons of things, and has defaults for mapping the F* keys to their Appley equivalents.

enter image description here

2
  • Unfortunately they don't currently support Sierra.
    – Machado
    Commented Aug 2, 2017 at 14:30
  • was struggling making my MacBook Pro 16 to type `\~ symbols on external mechanical KB - with this works nicely. thanks! Commented Nov 27, 2020 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .