mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Centralise generation of the control sequences for arrow keys into a
function in terminal.c, and replace the cloned-and-hacked handling code in all our front ends with calls to that. This was intended for code cleanliness, but a side effect is to make the GTK arrow-key handling support disabling of application cursor key mode in the Features panel. Previously that checkbox was accidentally ignored, and nobody seems to have noticed before! [originally from svn r8896]
This commit is contained in:
@ -737,23 +737,8 @@
|
||||
case NSLeftArrowFunctionKey: xkey = 'D'; break;
|
||||
}
|
||||
if (xkey) {
|
||||
/*
|
||||
* The arrow keys normally do ESC [ A and so on. In
|
||||
* app cursor keys mode they do ESC O A instead.
|
||||
* Ctrl toggles the two modes.
|
||||
*/
|
||||
if (term->vt52_mode) {
|
||||
output[end++] = '\033';
|
||||
output[end++] = xkey;
|
||||
} else if (!term->app_cursor_keys ^ !(m & NSControlKeyMask)) {
|
||||
output[end++] = '\033';
|
||||
output[end++] = 'O';
|
||||
output[end++] = xkey;
|
||||
} else {
|
||||
output[end++] = '\033';
|
||||
output[end++] = '[';
|
||||
output[end++] = xkey;
|
||||
}
|
||||
end += format_arrow_key(output+end, term, xkey,
|
||||
m & NSControlKeyMask);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user