]> granicus.if.org Git - nethack/commit
Fix alternate number pad interpretation only working for diagonals
authorFredrik Ljungdahl <fredde1994@gmail.com>
Wed, 27 Nov 2019 15:44:17 +0000 (16:44 +0100)
committerFredrik Ljungdahl <fredde1994@gmail.com>
Wed, 27 Nov 2019 16:08:10 +0000 (17:08 +0100)
commit9b42e32c3b208aa4220f54642953d4d7dc58e469
tree5440aab22f6d689f91de2a53bd2d4fe4d2936cea
parent31306760773b5200209869d62d73682ac53e67ec
Fix alternate number pad interpretation only working for diagonals

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).
win/curses/cursmisc.c