From 75f5abe9984cfb53d4d6c412f428aedbc9615999 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Fri, 28 Oct 2011 16:00:05 +0000 Subject: [PATCH] Improve support for keypad 5. --- rogue4/mdport.c | 7 +++++-- rogue5/mdport.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/rogue4/mdport.c b/rogue4/mdport.c index 4b8f656..c734b52 100644 --- a/rogue4/mdport.c +++ b/rogue4/mdport.c @@ -1172,6 +1172,9 @@ md_readchar(WINDOW *win) case '1': lastch = 'y'; mode=M_TRAIL; break; /* Home */ case '4': lastch = 'b'; mode=M_TRAIL; break; /* End */ + /* ESC [ - not understood by screen/tmux */ + case 'E': ch = '.'; break; /* Keypad 5 */ + /* ESC O - PuTTY */ case 'D': ch = MOD_MOVE('H'); break; case 'C': ch = MOD_MOVE('L'); break; @@ -1217,6 +1220,7 @@ md_readchar(WINDOW *win) case KEY_LL : ch = 'b'; break; #endif case KEY_NPAGE : ch = 'n'; break; + case KEY_BEG : ch = '.'; break; #ifdef KEY_B1 case KEY_B1 : ch = 'h'; break; @@ -1228,8 +1232,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/rogue5/mdport.c b/rogue5/mdport.c index b85ec98..e2cba78 100644 --- a/rogue5/mdport.c +++ b/rogue5/mdport.c @@ -1249,6 +1249,9 @@ md_readchar(WINDOW *win) case '1': lastch = 'y'; mode=M_TRAIL; break; /* Home */ case '4': lastch = 'b'; mode=M_TRAIL; break; /* End */ + /* ESC [ - not understood by screen/tmux */ + case 'E': ch = '.'; break; /* Keypad 5 */ + /* ESC O - PuTTY */ case 'D': ch = CTRL('H'); break; case 'C': ch = CTRL('L'); break; @@ -1294,6 +1297,7 @@ md_readchar(WINDOW *win) case KEY_LL : ch = 'b'; break; #endif case KEY_NPAGE : ch = 'n'; break; + case KEY_BEG : ch = '.'; break; #ifdef KEY_B1 case KEY_B1 : ch = 'h'; break; @@ -1305,8 +1309,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 = CTRL('L'); break;