1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 22:12:47 -05:00

Gaaah, I might have known. Split combined app cursor / app keypad

disablement option into two options so the app cursor keys and app
keypad can be controlled separately. The Pedantic Software Award in
this case goes to the Midnight Commander for its egregious failure
to just use the terminal in Perfectly Normal mode.

[originally from svn r766]
This commit is contained in:
Simon Tatham
2000-10-25 14:20:47 +00:00
parent 4aafc6e5c3
commit fc63ad0046
4 changed files with 29 additions and 15 deletions

View File

@ -1904,7 +1904,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
/* Nastyness with NUMLock - Shift-NUMLock is left alone though */
if ( (cfg.funky_type == 3 ||
(cfg.funky_type <= 1 && app_keypad_keys && !cfg.no_applic))
(cfg.funky_type <= 1 && app_keypad_keys && !cfg.no_applic_k))
&& wParam==VK_NUMLOCK && !(keystate[VK_SHIFT]&0x80)) {
wParam = VK_EXECUTE;
@ -1949,7 +1949,8 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
if (compose_state>1 && left_alt) compose_state = 0;
/* Sanitize the number pad if not using a PC NumPad */
if( left_alt || (app_keypad_keys && !cfg.no_applic && cfg.funky_type != 2)
if( left_alt || (app_keypad_keys && !cfg.no_applic_k
&& cfg.funky_type != 2)
|| cfg.funky_type == 3 || cfg.nethack_keypad || compose_state )
{
if ((HIWORD(lParam)&KF_EXTENDED) == 0)
@ -2032,13 +2033,13 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
if ( cfg.funky_type == 3 ||
( cfg.funky_type <= 1 &&
app_keypad_keys && !cfg.no_applic)) switch(wParam) {
app_keypad_keys && !cfg.no_applic_k)) switch(wParam) {
case VK_EXECUTE: xkey = 'P'; break;
case VK_DIVIDE: xkey = 'Q'; break;
case VK_MULTIPLY:xkey = 'R'; break;
case VK_SUBTRACT:xkey = 'S'; break;
}
if(app_keypad_keys && !cfg.no_applic) switch(wParam) {
if(app_keypad_keys && !cfg.no_applic_k) switch(wParam) {
case VK_NUMPAD0: xkey = 'p'; break;
case VK_NUMPAD1: xkey = 'q'; break;
case VK_NUMPAD2: xkey = 'r'; break;
@ -2200,7 +2201,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
{
if (vt52_mode)
p += sprintf((char *)p, "\x1B%c", xkey);
else if (app_cursor_keys && !cfg.no_applic)
else if (app_cursor_keys && !cfg.no_applic_c)
p += sprintf((char *)p, "\x1BO%c", xkey);
else
p += sprintf((char *)p, "\x1B[%c", xkey);