Hello Tasos,
Op 25-09-2026 om 12:07 schreef [email protected]:
Just pitching in to say that on my machine (Linux Mint 22.3 Xfce 64-bit, libncursesw6 v6.4+20240113-1ubuntu2.2) the numpad keys, including the hyphen, work as intended.
Strange. When on my laptop with Mint 22.3 (but without a numpad) I modify the keymap so that AltGr+u produces KP_Multiply, and so on for the neighbouring keys, then AltGr+u produces "[Unbound key]", and so do those neighbouring keys.
Obviously, the numpad hyphen has an entirely different keysym code than the main hyphen (main hyphen: 20 'minus', numpad hyphen: 82 'KP_subtract').
It depends. On my laptop that /does/ have a numpad, the numpad Enter produces the exact same keycode as the main Enter key, and the numpad Del produces the exact same keycode as the main Delete key. I've checked with `showkey` on a Linux console. Does your numpad actually produce KP_Subtract? You can check by enabling the "hex codes" fragment in src/winio.c, and then running `src/nano --ignore 2>TRAIL; cat TRAIL` and then typing some of the numpad keys before hitting ^X^Q. When they produce KP_* symbols, then the codes should be somewhere in 240-260 range.
One detail that might interest you is, when I press the numpad-hyphen with Shift and Ctrl, nothing happens. I find this interesting, because I would have expected an "Unbound key" message instead.
The Ctrl mechanics are probably defined only for ASCII codes, so it doesn't surprise me that Ctrl+KP_Subtract does not produce anything. Whether Shift plus the keypad minus key produces something depends on your keymap and whether your desktop intercepts the keystroke. (There were terminals where Shift++ and Shift+-, when using the <+> and <-> on the numpad, enlarged and shrunk the font.)
I have no idea if there is a way to represent the numpad-hyphen key with a unix/ emacs-like control code or not, but I suspect nano probably works at the ascii level, so presumably there won't be a way to distinguish the two, unless the specific terminal has a non-standard mapping for the keystroke. (in principle you can manipulate your terminal to do something special with the numpad hyphen ... but I suspect this isn't a general enough solution of interest to nano users in the more general sense).
I have a workaround working locally -- just have to test it on the various machines first before posting it here. Benno
OpenPGP_signature.asc
Description: OpenPGP digital signature
