1

I want to use the keypad, which is on the right of my keyboard, to move the cursor in a document, just like the arrow keys or the PgUp/PgDn keys. On a Windows machine, I can press NumLock to switch between entering numbers or moving the cursor. Unfortunately, on my new MacBook Pro, it only enters the numbers. For example, pressing 4 should move the cursor left one character, but it simply enters the number 4.

Apple support gave the following suggestions, none of which worked:

  1. press NumLock for 5 seconds (the Logitech keyboard has a clear button which is supposed to work the same way as NumLock)
  2. press Shift+NumLock. I also tried holding that down for 5 seconds.
  3. Check settings and make sure "Mouse Pointer" is turned off.

I tried two keyboards: A wireless Microsoft keyboard and a wireless Logitech keyboard.

Logitech support chat showed me how to reset the keyboard and how to configure the keyboard for the correct operating system. But neither of those made any difference.

What can I do to be able to use the number pad to move the cursor (not the mouse pointer)?

Update 1: I took allan's suggestion and redefined f12 to send the numLock key code. Unfortunately, that didn't help. I made sure the hidutil worked by changing f12 to send a 'z', which worked.

Update 2: I tried using a wired keyboard and an official Mac keyboard. Nothing worked the way I wanted. Allan's comment was what led me to my solution of remapping all of the keypad keys to the corresponding keyboard navigation keys.

3
  • This sounds like macOS is either not seeing Num Lock or processing it incorrectly. Try remapping it (hex: 0x53) to something else. See this answer for instructions. This will ensure Num Lock is actually the code being sent. If it still fails, there’s a deeper issue within macOS.
    – Allan
    Commented Mar 6, 2023 at 19:31
  • I saw your edit...it seems macOS isn't interpreting the Num Lock key properly. I was hoping that by remapping, the proper hex code would be sent. Since it is, it means something in macOS is not interpreting it correctly
    – Allan
    Commented Mar 6, 2023 at 22:07
  • Thanks. I'm glad to have the key remapping tool in my pocket now. I hope I don't have to replace the computer. I'll bring it to the store to see if an apple keyboard works.
    – redlum
    Commented Mar 8, 2023 at 14:19

1 Answer 1

1

I was unable to get NumLock/Clear to work the way I wanted. However, I was able to remap all of the keypad keys to the navigation keys. Here are two bash scripts that I'm using. One for mapping to use navigation keys. The other for removing all key mappings if you want to go back to using the keypad as a number pad.

#!/bin/bash
# maps keypad to navigation keys. 
# link to find key mappings
# https://developer.apple.com/library/archive/technotes/tn2450/_index.html
# Keyboard Home 0x4A
# Keypad 7 and Home 0x5F

# Keyboard Up Arrow 0x52
# Keypad 8 and Up Arrow 0x60

# Keyboard Page Up 0x4B
# Keypad 9 and Page Up 0x61

# Keyboard Left Arrow 0x50
# Keypad 4 and Left Arrow 0x5C

# Keyboard Right Arrow 0x4F
# Keypad 6 and Right Arrow 0x5E

# Keyboard End 0x4D
# Keypad 1 and End 0x59

# Keyboard Down Arrow 0x51
# Keypad 2 and Down Arrow 0x5A

# Keyboard Page Down 0x4E
# Keypad 3 and Page Down 0x5B

# Keyboard Insert 0x49
# Keypad 0 and Insert 0x62

# Keyboard Delete Forward 0x4C
# Keypad . and Delete 0x63
hidutil property --set '{"UserKeyMapping": [{"HIDKeyboardModifierMappingSrc":0x70000005F, "HIDKeyboardModifierMappingDst":0x70000004A}, {"HIDKeyboardModifierMappingSrc":0x700000060, "HIDKeyboardModifierMappingDst":0x700000052}, {"HIDKeyboardModifierMappingSrc":0x700000061, "HIDKeyboardModifierMappingDst":0x70000004B}, {"HIDKeyboardModifierMappingSrc":0x70000005C, "HIDKeyboardModifierMappingDst":0x700000050}, {"HIDKeyboardModifierMappingSrc":0x70000005E, "HIDKeyboardModifierMappingDst":0x70000004F}, {"HIDKeyboardModifierMappingSrc":0x700000059, "HIDKeyboardModifierMappingDst":0x70000004D}, {"HIDKeyboardModifierMappingSrc":0x70000005A, "HIDKeyboardModifierMappingDst":0x700000051}, {"HIDKeyboardModifierMappingSrc":0x70000005B, "HIDKeyboardModifierMappingDst":0x70000004E}, {"HIDKeyboardModifierMappingSrc":0x700000062, "HIDKeyboardModifierMappingDst":0x700000049}, {"HIDKeyboardModifierMappingSrc":0x700000063, "HIDKeyboardModifierMappingDst":0x70000004C}]}'

and the bash script to remove the key mappings:

#!/bin/bash
# remove all mappings
hidutil property --set '{"UserKeyMapping": []}'

You must log in to answer this question.

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