Karabiner-elements: FN + [789uiojkl] -> NumPad support?

Created on 24 Sep 2016  ·  17Comments  ·  Source: pqrs-org/Karabiner-Elements

I recently (foolishly) upgraded to macOS Sierra on my MacBook Pro, only to find that I had lost the ability to hold FN and get access to the missing numpad feature. After installing Karabiner-Elements, I see that configuration currently involves manually editing a JSON file to enable functionality - but after reviewing what's currently provided in the /examples/ folder in this repo, I'm still not able to understand what I would need to put my config file to bring back some numpad functionality. Is Karabiner-Elements at a point where this is possible and another example config file can be added for the lay-user, or is this something where I will need to wait until Karabiner proper is updated to support macOS Sierra?

stale

Most helpful comment

I think I've come up with a karabiner.json file for Karabiner-Elements on a Sierra MacBook that maps fn + jkl; to 123-, etc., just like the old Karabiner before Sierra. I'm using it now, and it seems to be working well.

It maps fn + regular jkluio789 keys to keypad 123456789 keys, and it maps fn + regular . / ; p 0 keys to keypad . / - + * keys. (It leaves the regular comma alone, since there's no keypad comma - I think.)

To install it, quit Karabiner-Elements. Go to your user name's home directory, and press shift+command+period to see the invisible folders (you probably need Admin privileges). Open the .config/karabiner folder and drag the current karabiner.json file to your desktop. Drag peterpqa-karabiner.json.txt into the .config/karabiner folder, and rename it to karabiner.json. Restart Karabiner-Elements.

It would be great if somebody smarter than me could check this file over and make sure it's all right and proper. If it passes muster, maybe it can be considered for an importable Complex Modification Rule.

peterpqa-karabiner.json.txt

All 17 comments

@AdmiralPotato At the moment Karabiner-Elements only offer one to one key mapping like mapping Caps Lock to Escape key.

For mapping multiple keys to one or one to multiple keys, wait for #16.
For having different keys depending on the hold duration, wait for #8

I think that what I'm looking for is exclusively mapping multiple keys to one key, so #16 it is.
Thank you, I will now watch that ticket. 👍

In case anybody is interested, this is how I solved the mapping of macbook keyboard to numeric keys:
"complex_modifications": { "parameters": { "basic.to_if_alone_timeout_milliseconds": 1000 }, "rules": [{ "description": "macbook keyboard to numeric keypad (using Fn + J/K/L etc.)", "manipulators": [{ "from": { "key_code": "m", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "0" }], "type": "basic" }, { "from": { "key_code": "j", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "1" }], "type": "basic" }, { "from": { "key_code": "k", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "2" }], "type": "basic" }, { "from": { "key_code": "l", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "3" }], "type": "basic" }, { "from": { "key_code": "u", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "4" }], "type": "basic" }, { "from": { "key_code": "i", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "5" }], "type": "basic" }, { "from": { "key_code": "o", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "6" }], "type": "basic" }] },

an update to @kolydart solution that maps they keys to actual keypad key codes, instead of just making them numbers.

{
  "description": "macbook keyboard to numeric keypad (using Fn + J/K/L etc.)",
  "manipulators": [
    {
      "from": {
        "key_code": "m",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_0"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "j",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_1"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "k",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_2"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "l",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_3"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "u",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_4"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "i",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_5"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "o",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_6"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "7",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_7"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "8",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_8"
        }
      ],
      "type": "basic"
    },
    {
      "from": {
        "key_code": "9",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "keypad_9"
        }
      ],
      "type": "basic"
    }
  ]
}

Hi, have you tried adding the other numeric keypad keys (I mean, .,+-*/)? I can't manage to make them work. Probably, I'm not using the right spelling (I've tried, for example, both "keypad_." and "keypad_period", and the like, with no results).

@ptram The following worked for me. I'm sure these won't be the keys you want to bind, but they're what I used for testing:

{
    "from": {
        "key_code": "s",
        "modifiers": {
            "mandatory": [
                "fn"
            ],
            "optional": [
                "any"
            ]
        }
    },
    "to": [
        {
            "key_code": "keypad_plus"
        }
    ],
    "type": "basic"
},
{
    "from": {
        "key_code": "q",
        "modifiers": {
            "mandatory": [
                "fn"
            ],
            "optional": [
                "any"
            ]
        }
    },
    "to": [
        {
            "key_code": "keypad_hyphen"
        }
    ],
    "type": "basic"
},
{
    "from": {
        "key_code": "w",
        "modifiers": {
            "mandatory": [
                "fn"
            ],
            "optional": [
                "any"
            ]
        }
    },
    "to": [
        {
            "key_code": "keypad_slash"
        }
    ],
    "type": "basic"
},
{
    "from": {
        "key_code": "f",
        "modifiers": {
            "mandatory": [
                "fn"
            ],
            "optional": [
                "any"
            ]
        }
    },
    "to": [
        {
            "key_code": "keypad_period"
        }
    ],
    "type": "basic"
},
{
    "from": {
        "key_code": "a",
        "modifiers": {
            "mandatory": [
                "fn"
            ],
            "optional": [
                "any"
            ]
        }
    },
    "to": [
        {
            "key_code": "keypad_asterisk"
        }
    ],
    "type": "basic"
}

@jvinding , thank you very much! This is going nearer to a solution.

I could make key_code 'é' remap to keypad_slash, and key_code 'p' remap to keypad_asterisk on my custom layout (a modified Italian ISO layout).

I still can't remap key_code 'm', 'ò', '.' and ':' to, respectively, keypad_hyphen, keypad_plus, keypad_period and keypad_comma. I wonder why.

I'm not sure about your particular keyboard, but on U.S. keyboards : would be mapped like:

{
    "from": {
        "key_code": "semicolon",
        "modifiers": {
            "mandatory": [
                "shift"
            ],
            "optional": [
                "any"
            ]
        }
    },
    "to": [
        {
            "key_code": "keypad_period"
        }
    ],
    "type": "basic"
}

2 things to note there semicolon not ;, and 2 is shift as a mandatory modifier.

You can use the Karabiner-EventViewer to see the names of the keys you're trying to map.

@jvinding , thank you very much! I could finally work on it, and it works great!
Not all keys can actually work, but the numeric keys do work, and this is enough.
Weird that InDesign refuses to recognize them as numeric keypad keys.

Paolo

I think I've come up with a karabiner.json file for Karabiner-Elements on a Sierra MacBook that maps fn + jkl; to 123-, etc., just like the old Karabiner before Sierra. I'm using it now, and it seems to be working well.

It maps fn + regular jkluio789 keys to keypad 123456789 keys, and it maps fn + regular . / ; p 0 keys to keypad . / - + * keys. (It leaves the regular comma alone, since there's no keypad comma - I think.)

To install it, quit Karabiner-Elements. Go to your user name's home directory, and press shift+command+period to see the invisible folders (you probably need Admin privileges). Open the .config/karabiner folder and drag the current karabiner.json file to your desktop. Drag peterpqa-karabiner.json.txt into the .config/karabiner folder, and rename it to karabiner.json. Restart Karabiner-Elements.

It would be great if somebody smarter than me could check this file over and make sure it's all right and proper. If it passes muster, maybe it can be considered for an importable Complex Modification Rule.

peterpqa-karabiner.json.txt

Thank you peterpqa !
This works totally !

@peterpqa You're my hero!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Thank you petrpqa it works for me too :-)

But 1 thing is missing :-(

I was used to not hold FN key to imput numbers, so my left hand was free.

I just pressed F9 (or right cmd+F9 I do not rememeber now) and It wrote on top panel NumPad(Profile).

And when I wanted to cancel NumPad I pressed F9 again. Simple and practical.
Can anyone helps to update karabiner.json for this?

Thank you.

XSM

Original code is here:
private.xml




NumLock to F9
remap.numlock2f9
__KeyToKey__ ConsumerKeyCode::NUMLOCK, KeyCode::F9

──────────────────────────────

F9 to Virtual NumLock
Unlike Fn_Lock, retaining cursor keys, delete key.

Virtual NumLock
6 7 8 9 0 - → Clear 7 8 9 / =
U I O P → 4 5 6 *
J K L ; → 1 2 3 -
M . / → 0 . +
notsave.virtual_numlock
__ShowStatusMessage__ NumLock
__KeyToKey__ KeyCode::M, KeyCode::KEYPAD_0
__KeyToKey__ KeyCode::J, KeyCode::KEYPAD_1
__KeyToKey__ KeyCode::K, KeyCode::KEYPAD_2
__KeyToKey__ KeyCode::L, KeyCode::KEYPAD_3
__KeyToKey__ KeyCode::U, KeyCode::KEYPAD_4
__KeyToKey__ KeyCode::I, KeyCode::KEYPAD_5
__KeyToKey__ KeyCode::O, KeyCode::KEYPAD_6
__KeyToKey__ KeyCode::KEY_7, KeyCode::KEYPAD_7
__KeyToKey__ KeyCode::KEY_8, KeyCode::KEYPAD_8
__KeyToKey__ KeyCode::KEY_9, KeyCode::KEYPAD_9
__KeyToKey__ KeyCode::KEY_6, KeyCode::KEYPAD_CLEAR
__KeyToKey__ KeyCode::SLASH, KeyCode::KEYPAD_PLUS
__KeyToKey__ KeyCode::SEMICOLON, KeyCode::KEYPAD_MINUS
__KeyToKey__ KeyCode::P, KeyCode::KEYPAD_MULTIPLY
__KeyToKey__ KeyCode::KEY_0, KeyCode::KEYPAD_SLASH
__KeyToKey__ KeyCode::MINUS, KeyCode::KEYPAD_EQUAL
__KeyToKey__ KeyCode::DOT, KeyCode::KEYPAD_DOT


F9 to toggle "Virtual NumLock"
remap.f9_to_virtual_numlock
__KeyToKey__ KeyCode::F9, KeyCode::VK_CONFIG_TOGGLE_notsave_virtual_numlock



F9 to Fn_Lock (except virtual machine, RDC)
remap.f9_to_numlock
VIRTUALMACHINE, REMOTEDESKTOPCONNECTION
__KeyToKey__ KeyCode::F9, KeyCode::VK_LOCK_FN

──────────────────────────────

Forgive me for resurrecting this, but did this feature ever get added? That's precisely what I need: Easy FN + [789uiojkl] -> NumPad support. To my understanding, KeyRemap4MacBook did this on installation, with no configuration required.

YES PLEASE !!! Easy NumPad, but also with F9, so you not need left hand at all. Already in installation. PLEASE !!

Was this page helpful?
0 / 5 - 0 ratings