How to make NumLock/numpad cursor keys work on an external USB keyboard?

I have a Genius USB "partial" keyboard - a numpad like this one.

It types digits and +-/*, but doesn't switch to cursor mode with NumLock off, and Home/End/PgUp/PgDn keys were the reason I purchased it.

How do I make Home/End/other cursor keys work?

  • Sometimes USB keyboards don't work if Mouse Keys in Mouse Settings is on. Mine is off.
  • Sometimes hitting Clear key on the keyboard helps. I don't have it.
  • Ukelele doesn't have the numpad keys to edit.
  • Karabiner (ex KeyRemap4MacBook) doesn't have a ready feature for this.

The solution according to this answer seems to be Karabiner. Though, it looks pretty advanced and I didn't find it in half an hour.


With the latest karabiner, there is a defined complex rule to enable this rather easily. You just need to import and enable these rules:

https://ke-complex-modifications.pqrs.org/#numpad


OS X does not understand 'Num lock'. There's no on-off state for Num lock in OS X and as such can be thought to be always on.

The Num lock button itself on a Windows keyboard is interpreted as Clear in OS X. You are able to bind this to actions in Keyboard Maestro, but a 'state switch' would essentially require saving a variable in Keyboard Maestro to be checked when a button is pressed, then intercepting the action and providing its own key press.


I had a similar issue and made my complex_modifications for Karabiner Elements available in a pull request here: https://github.com/pqrs-org/KE-complex_modifications/pull/509


Here's what I put in my private.xml file (using Karabiner.app), and it allows the following functionality:

Use a generic external numerical keypad with Mac OS X, and Num Lock on/off toggles number vs arrow/Home/End/PgUp/PgDn functionality. Num Lock light turns on/off as appropriate as well :-)

<?xml version="1.0"?>
<root>
    <item>
        <name>Toggle Numbers/Arrows</name>
        <identifier>private.toggle_numbers_arrows</identifier>
        <autogen>
            __KeyToKey__ KeyCode::KEYPAD_CLEAR, 
            KeyCode::VK_CONFIG_TOGGLE_remap_keypadnumlock, 
            KeyCode::VK_IOHIKEYBOARD_TOGGLE_NUMLOCK,
            KeyCode::VK_IOHIKEYBOARD_TOGGLE_NUMLOCK,
            KeyCode::VK_IOHIKEYBOARD_TOGGLE_NUMLOCK
        </autogen>
    </item>
</root>

As you can see, I needed to include the "...TOGGLE_NUMLOCK" three times to get the Num Lock LED status to appropriately indicate the state (otherwise it was backwards, whereas it would be lit for arrow functions and dark for numbers). Maybe there's a simple way to fix it, but the hack works perfectly for me. Hopefully someone else finds this useful!


After a better look, I found it in Karabiner: "For PC users" - "Use KeyPad as Arrow" - "Enable KeyPad as Arrow".

I'll leave the question here, it might be useful for someone else.

Update: Karabiner-Elements, which is the only Karabiner for Sierra+, is a new product. In Karabiner-Elements, I just added a mapping from every numpad key to its function, for external keyboard.