Num Lock Shift Fix for NVDA

Baca dalam Bahasa Indonesia

Num Lock Shift Fix is an add-on for the NVDA screen reader. With Num Lock on, it gives the whole number pad to the program you are in, Shift and the pad keys too. Without it, NVDA takes Shift and a number pad key as one of its own commands, even though Num Lock is on.

The problem

With Num Lock on, the number pad types digits and NVDA leaves it alone. But Windows has an old rule: while Shift is held, the number pad acts as if Num Lock were off, and Windows lets go of Shift before it sends the key. So Shift and numpad 1 arrives as End, Shift and numpad 4 as Left, and Shift and numpad 0 as Insert.

NVDA hears exactly what it hears with Num Lock off. Shift and numpad 1 runs "move the review cursor to the previous character", Shift and numpad 8 reads the current line, and Shift and numpad 0 becomes the NVDA key. The program never gets the key. Ctrl and the number pad are not affected, because the rule is only for Shift.

You can hear it with input help (NVDA+1): with Num Lock on, press Shift and numpad 1. NVDA reports "left shift", then "numpad 1" and the review cursor command, not Shift and the digit.

This matters in games and programs that use Shift with the number pad, for example to aim up while the pad gives directions.

What it does

While Num Lock is on:

  • Shift and numpad 1 to 9, and the dot, go to the program, as they would without NVDA.
  • Shift and numpad 0 is not the NVDA key. It goes to the program too.
  • A key pressed together with the NVDA key is still NVDA's.

While Num Lock is off, nothing changes: the number pad has NVDA's review commands, and numpad 0 (Insert) is the NVDA key if you chose it as one.

Most programs then do what Windows does with those keys. In a text field, Shift and numpad 4 selects one character to the left, as Shift and Left Arrow does. A program that reads the number pad itself, such as a game, can tell the pad's keys from the arrow keys and read them as Shift and the digit.

Requirements

NVDA 2025.1 or later.

Install

Download the .nvda-addon file from the latest release, open it, accept the installation, and restart NVDA.

How it works

The add-on is one global plugin, addon/globalPlugins/numLockShift.py:

  • NVDA asks global plugins for a key's command before app modules and its own commands. For a number pad key that is not extended (the arrow keys and Insert of their own are extended) while Num Lock is on, the plugin answers with a command that sends the key on to the program.
  • NVDA decides whether a key is the NVDA key with keyboardHandler.isNVDAModifierKey. The plugin wraps it so numpad Insert is not the NVDA key while Num Lock is on, and puts the original back when NVDA stops the plugin.

Build

pip install -r requirements-dev.txt
python build_addon.py

The add-on is written to dist/. pytest runs the tests, ruff check . and ruff format --check . the checks.

License

GPL-2.0, like NVDA. See COPYING.txt.