9

Is there any way to change the key mapping of the apple keyboard?

As programmer I find annoying there's a comma instead a dot in numeric keypad. I would remap this key to have dot ...

15

The simplest solution is to create the file DefaultKeyBinding.dict in /Users/[user]/Library/KeyBindings if it does not already exist, and add the remapping:

{
   "#," = ("insertText:", ".");
}

Then restart the mac.

The # indicates the remapping is for the keypad only. More reference for that file: https://gist.github.com/trusktr/1e5e516df4e8032cbc3d

| improve this answer | |
  • 1
    Thanks ! I've been looking for something like this for few months. I didn't wanted to download a tool for this purpose.... – Stéphane Aug 6 '18 at 6:28
  • This should be accepted as the answer, +1 for not needing another tool. By the way, a restart isn't necessary, just log out and log back in. – BoDeX Aug 21 '19 at 2:16
  • This solution is working in Catalina (10.15 Beta) with no problems. – Rodrirokr Sep 19 '19 at 2:23
  • Working on Catalina 10.15.2 – floatingpurr Jan 27 at 13:38
  • Hi! I wanted to achieve the same result but in reverse, so dot to a comma. I placed this: { "#." = ("insertText:". ","); } in ~/Library/KeyBindings/DefaultKeyBinding.dict but it doesn't seem to work. I also tried with { "#," = ("insertText:". ","); } , but still not working... :( – panosru Oct 10 at 11:01
4

based on Matías González answer:

Step 1, Add the remapping (paste this command on your console):

mkdir ~/Library/KeyBindings && cd ~/Library/KeyBindings && touch DefaultKeyBinding.dict && echo '{"#," = ("insertText:", ".");}' > DefaultKeyBinding.dict

Step 2, Restart the mac

The # indicates the remapping is for the keypad only. More reference for that file: https://gist.github.com/trusktr/1e5e516df4e8032cbc3d

| improve this answer | |
1

One solution is Karabiner (prior to version 9.3.0, Karabiner was called KeyRemap4MacBook). It allows you to remap specific keys or change then entire keyboard layout, as described here.

It is a powerful keyboard remapper that can change not only the functionality of keys and key combinations, but just about everything related to how a key repeats when you hold it down. Keyboard remappings are highly customizable (although it's not a so simple process). You can change practically anything: you can search through all the options and quickly find what you're looking for, or just browse by category. It's very powerful and usage is pretty straightforward.

The drawback is that keyboard remapping functions are predefined and you can just check them off. If you want to add custom remapping functions, you have to edit an XML file. When you're using a GUI application this is not exactly the ideal experience. That said, this is the only significant drawback.

| improve this answer | |
  • Thanks for this one... I'm starting to do my taxes for 2017 and it was really bugging the crap out of me in excel! – BadgerBadger Dec 30 '17 at 18:04

You must log in to answer this question.

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