From d793ca961f822670a1e2ae372290984672edd78a Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Wed, 27 May 2015 17:29:32 -0400 Subject: [PATCH] arogue7, xrogue: add support for keypad 5. Keypad 5 is now equivalent to the '.' key. XRogue does not include md_readchar() and its ability to work around deficiencies in the terminfo entry. So the key will not be recognized in screen/tmux or anywhere else without the kb2 capability. Adding md_readchar() would be more complex than it was for Super-Rogue, since XRogue already does KEY_* interpretation in command(). --- arogue7/mdport.c | 6 ++++-- xrogue/command.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arogue7/mdport.c b/arogue7/mdport.c index 391ca40..cbbadb2 100644 --- a/arogue7/mdport.c +++ b/arogue7/mdport.c @@ -1073,6 +1073,9 @@ md_readchar(WINDOW *win) case '1': lastch = 'y'; mode=M_TRAIL; break; /* Home */ case '4': lastch = 'b'; mode=M_TRAIL; break; /* End */ + /* ESC [ - screen/tmux */ + case 'E': ch = '.'; break; + /* ESC O - PuTTY */ case 'D': ch = MOD_MOVE('H'); break; case 'C': ch = MOD_MOVE('L'); break; @@ -1124,8 +1127,7 @@ md_readchar(WINDOW *win) case KEY_A3 : ch = 'u'; break; case KEY_C1 : ch = 'b'; break; case KEY_C3 : ch = 'n'; break; - /* next should be '.', but for problem with putty/linux */ - case KEY_B2 : ch = 'u'; break; + case KEY_B2 : ch = '.'; break; #ifdef KEY_SLEFT case KEY_SRIGHT : ch = MOD_MOVE('L'); break; diff --git a/xrogue/command.c b/xrogue/command.c index 5e1e045..d83a9a6 100644 --- a/xrogue/command.c +++ b/xrogue/command.c @@ -344,6 +344,7 @@ command() player.t_action = A_NIL; } when '.' : + case KEY_B2 : player.t_no_move = movement(&player); /* Rest */ player.t_action = A_NIL; when ' ' : after = FALSE; /* Do Nothing */