The numeric keypad block is found on the far right of most full-sized PC keyboards. The keys belonging to this block have few specifics that set them apart from other mappable keys.
The effect of NumLock
The main feature of the numpad keys is their dual function - depending on the state of the NumLock toggle key (VK_NUMLOCK virtual key code), they can behave either as regular mappable keys (NumLock ON), or cursor navigation keys Left / Right / Home / End / Delete / etc (NumLock OFF).
The reason for this is historical: early 83- and 84-key PC keyboards did not have a dedicated navigation key "island". The navigation functions were only available as an alternative function of the numpad block.
Note that this duality is only present in the digit keys 0-9 (VK_NUMPAD0 - VK_NUMPAD9), and the decimal point (VK_DECIMAL). The remaining numpad keys / , * , - , + and Enter are not affected by NumLock. The NumLock-dependent behavior is summarised in this table:
The NumLock switching behaviour is specific to the VK_NUMPAD0 - VK_NUMPAD9 and VK_DECIMAL VK codes, regardless of the physical keys they are assigned to. It is thus possible to emulate the numpad functionality even on keyboards that are missing the dedicated numeric keypad, simply by assigning the numpad VK codes to the desired physical keys using the Low-level editor.
It is worth pointing out that, in the NumLock ON state, the VK_NUMPAD0 - VK_NUMPAD9 are not restricted to digits 0-9. They are still regular mappable keys, which can accept any arbitrary Unicode character, dead key or a ligature on any modifier position, with few restrictions related to the Shift modifier (see below).
The effect of Shift
Another unique feature of the numpad keys is their interaction with the Shift modifier key: instead of switching the SHIFT modifier bit on/off, the Shift key's effect is to temporarily invert the NumLock state.
Thus if NumLock is ON, SHIFT+VK_NUMPAD1 will produce the NumLock OFF function, ie the End navigation key.
Likewise, if NumLock is OFF, SHIFT+VK_NUMPAD1 will produce the NumLock ON function, ie digit 1.
Due to this, the SHIFT modifier positions of the numpad keys are generally not available for the high-level Unicode mappings. The High-level editor highlights this by making the numpad SHIFT positions read-only, and displaying further clarification in the tool tip:
Numpad keys have another surprise in store - even though they don't accept the SHIFT key as a general-purpose modifier, some of their SHIFT positions can still produce Unicode mappings in combination with Caps Lock:
In both special cases, the corresponding SHIFT position(s) are shown as editable in the High-level editor, with the tool tip indicating that the mapping is available in combination with CapsLock ON:
Copyright © KbdSoft 2007-2021