This fixes the issue brought up at https://www.reddit.com/r/nethack/comments/dv3pae/curses_and_the_numberpad/?st=k3hgply6&sh=dbc2bf7d . I don't know why the "regular" (tty) method doesn't seem to work for him, but I'm going to chalk it up to a PDCurses oddity. What I do know, however, is that the alternate method I added a year ago or maybe longer, that allows numpad usage even with number_pad:0 (to retain the default keybindings in case an user is used to them, while keeping number pad behaviour making sense, similar to NetHack4+friends) was only partially implemented, for some reason. This adds the rest of the keys, meaning that this means of key interpretation should be more realible. KEY_A2/B1/B3/C2 are not standard keys in the Curses documentation, and is thus behind an ifdef -- but PDCurses, amongst other implementations, makes use of them. As a side effect, Home/End/PgUp/PgDn are now interpreted as diagonal movement, since some terminals interpret number_pad keys that way. I do not consider this a problem since they went unused in normal gameplay anyway (This does not interfere with menus or similar).
29 KiB
29 KiB