tweaks: condense or rewrap a bunch of repetitious comments

master
Benno Schulenberg 2017-12-11 20:01:56 +01:00
parent bcd187d7d6
commit a95c6c5fe8
1 changed files with 41 additions and 94 deletions

View File

@ -876,17 +876,13 @@ int convert_sequence(const int *seq, size_t seq_len)
* NumLock off on VT100/VT220/VT320/xterm/ * NumLock off on VT100/VT220/VT320/xterm/
* rxvt/Eterm. */ * rxvt/Eterm. */
return KEY_ENTER; return KEY_ENTER;
case 'P': /* Esc O P == F1 on VT100/VT220/VT320/Mach case 'P': /* Esc O P == F1 on VT100/VT220/VT320/Mach console. */
* console. */
return KEY_F(1); return KEY_F(1);
case 'Q': /* Esc O Q == F2 on VT100/VT220/VT320/Mach case 'Q': /* Esc O Q == F2 on VT100/VT220/VT320/Mach console. */
* console. */
return KEY_F(2); return KEY_F(2);
case 'R': /* Esc O R == F3 on VT100/VT220/VT320/Mach case 'R': /* Esc O R == F3 on VT100/VT220/VT320/Mach console. */
* console. */
return KEY_F(3); return KEY_F(3);
case 'S': /* Esc O S == F4 on VT100/VT220/VT320/Mach case 'S': /* Esc O S == F4 on VT100/VT220/VT320/Mach console. */
* console. */
return KEY_F(4); return KEY_F(4);
case 'T': /* Esc O T == F5 on Mach console. */ case 'T': /* Esc O T == F5 on Mach console. */
return KEY_F(5); return KEY_F(5);
@ -912,45 +908,27 @@ int convert_sequence(const int *seq, size_t seq_len)
* NumLock off on VT100/VT220/VT320/xterm/ * NumLock off on VT100/VT220/VT320/xterm/
* rxvt/Eterm/Terminal. */ * rxvt/Eterm/Terminal. */
return '*'; return '*';
case 'k': /* Esc O k == '+' on numeric keypad with case 'k': /* Esc O k == '+' on the same. */
* NumLock off on VT100/VT220/VT320/xterm/
* rxvt/Eterm/Terminal. */
return '+'; return '+';
case 'l': /* Esc O l == ',' on numeric keypad with case 'l': /* Esc O l == ',' on the same. */
* NumLock off on VT100/VT220/VT320/xterm/
* rxvt/Eterm/Terminal. */
return ','; return ',';
case 'm': /* Esc O m == '-' on numeric keypad with case 'm': /* Esc O m == '-' on the same. */
* NumLock off on VT100/VT220/VT320/xterm/
* rxvt/Eterm/Terminal. */
return '-'; return '-';
case 'n': /* Esc O n == Delete (.) on numeric keypad case 'n': /* Esc O n == Delete (.) on the same. */
* with NumLock off on VT100/VT220/VT320/
* xterm/rxvt/Eterm/Terminal. */
return KEY_DC; return KEY_DC;
case 'o': /* Esc O o == '/' on numeric keypad with case 'o': /* Esc O o == '/' on the same. */
* NumLock off on VT100/VT220/VT320/xterm/
* rxvt/Eterm/Terminal. */
return '/'; return '/';
case 'p': /* Esc O p == Insert (0) on numeric keypad case 'p': /* Esc O p == Insert (0) on numeric keypad
* with NumLock off on VT100/VT220/VT320/ * with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */ * rxvt/Eterm/Terminal. */
return KEY_IC; return KEY_IC;
case 'q': /* Esc O q == End (1) on numeric keypad case 'q': /* Esc O q == End (1) on the same. */
* with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */
return KEY_END; return KEY_END;
case 'r': /* Esc O r == Down (2) on numeric keypad case 'r': /* Esc O r == Down (2) on the same. */
* with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */
return KEY_DOWN; return KEY_DOWN;
case 's': /* Esc O s == PageDown (3) on numeric case 's': /* Esc O s == PageDown (3) on the same. */
* keypad with NumLock off on VT100/VT220/
* VT320/rxvt/Eterm/Terminal. */
return KEY_NPAGE; return KEY_NPAGE;
case 't': /* Esc O t == Left (4) on numeric keypad case 't': /* Esc O t == Left (4) on the same. */
* with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */
return KEY_LEFT; return KEY_LEFT;
case 'u': /* Esc O u == Center (5) on numeric keypad case 'u': /* Esc O u == Center (5) on numeric keypad
* with NumLock off on VT100/VT220/VT320/ * with NumLock off on VT100/VT220/VT320/
@ -960,17 +938,11 @@ int convert_sequence(const int *seq, size_t seq_len)
* with NumLock off on VT100/VT220/VT320/ * with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */ * rxvt/Eterm/Terminal. */
return KEY_RIGHT; return KEY_RIGHT;
case 'w': /* Esc O w == Home (7) on numeric keypad case 'w': /* Esc O w == Home (7) on the same. */
* with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */
return KEY_HOME; return KEY_HOME;
case 'x': /* Esc O x == Up (8) on numeric keypad case 'x': /* Esc O x == Up (8) on the same. */
* with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */
return KEY_UP; return KEY_UP;
case 'y': /* Esc O y == PageUp (9) on numeric keypad case 'y': /* Esc O y == PageUp (9) on the same. */
* with NumLock off on VT100/VT220/VT320/
* rxvt/Eterm/Terminal. */
return KEY_PPAGE; return KEY_PPAGE;
} }
break; break;
@ -999,20 +971,14 @@ int convert_sequence(const int *seq, size_t seq_len)
return KEY_F(3); return KEY_F(3);
case '4': /* Esc [ 1 4 ~ == F4 on rxvt/Eterm. */ case '4': /* Esc [ 1 4 ~ == F4 on rxvt/Eterm. */
return KEY_F(4); return KEY_F(4);
case '5': /* Esc [ 1 5 ~ == F5 on xterm/ case '5': /* Esc [ 1 5 ~ == F5 on xterm/rxvt/Eterm. */
* rxvt/Eterm. */
return KEY_F(5); return KEY_F(5);
case '7': /* Esc [ 1 7 ~ == F6 on case '7': /* Esc [ 1 7 ~ == F6 on VT220/VT320/
* VT220/VT320/Linux console/ * Linux console/xterm/rxvt/Eterm. */
* xterm/rxvt/Eterm. */
return KEY_F(6); return KEY_F(6);
case '8': /* Esc [ 1 8 ~ == F7 on case '8': /* Esc [ 1 8 ~ == F7 on the same. */
* VT220/VT320/Linux console/
* xterm/rxvt/Eterm. */
return KEY_F(7); return KEY_F(7);
case '9': /* Esc [ 1 9 ~ == F8 on case '9': /* Esc [ 1 9 ~ == F8 on the same. */
* VT220/VT320/Linux console/
* xterm/rxvt/Eterm. */
return KEY_F(8); return KEY_F(8);
} }
} else if (seq_len > 4 && seq[2] == ';') { } else if (seq_len > 4 && seq[2] == ';') {
@ -1103,26 +1069,20 @@ int convert_sequence(const int *seq, size_t seq_len)
case '0': /* Esc [ 2 0 ~ == F9 on VT220/VT320/ case '0': /* Esc [ 2 0 ~ == F9 on VT220/VT320/
* Linux console/xterm/rxvt/Eterm. */ * Linux console/xterm/rxvt/Eterm. */
return KEY_F(9); return KEY_F(9);
case '1': /* Esc [ 2 1 ~ == F10 on VT220/VT320/ case '1': /* Esc [ 2 1 ~ == F10 on the same. */
* Linux console/xterm/rxvt/Eterm. */
return KEY_F(10); return KEY_F(10);
case '3': /* Esc [ 2 3 ~ == F11 on VT220/VT320/ case '3': /* Esc [ 2 3 ~ == F11 on the same. */
* Linux console/xterm/rxvt/Eterm. */
return KEY_F(11); return KEY_F(11);
case '4': /* Esc [ 2 4 ~ == F12 on VT220/VT320/ case '4': /* Esc [ 2 4 ~ == F12 on the same. */
* Linux console/xterm/rxvt/Eterm. */
return KEY_F(12); return KEY_F(12);
case '5': /* Esc [ 2 5 ~ == F13 on VT220/VT320/ case '5': /* Esc [ 2 5 ~ == F13 on VT220/VT320/
* Linux console/rxvt/Eterm. */ * Linux console/rxvt/Eterm. */
return KEY_F(13); return KEY_F(13);
case '6': /* Esc [ 2 6 ~ == F14 on VT220/VT320/ case '6': /* Esc [ 2 6 ~ == F14 on the same. */
* Linux console/rxvt/Eterm. */
return KEY_F(14); return KEY_F(14);
case '8': /* Esc [ 2 8 ~ == F15 on VT220/VT320/ case '8': /* Esc [ 2 8 ~ == F15 on the same. */
* Linux console/rxvt/Eterm. */
return KEY_F(15); return KEY_F(15);
case '9': /* Esc [ 2 9 ~ == F16 on VT220/VT320/ case '9': /* Esc [ 2 9 ~ == F16 on the same. */
* Linux console/rxvt/Eterm. */
return KEY_F(16); return KEY_F(16);
} }
} else if (seq_len > 2 && seq[2] == '~') } else if (seq_len > 2 && seq[2] == '~')
@ -1135,8 +1095,8 @@ int convert_sequence(const int *seq, size_t seq_len)
if (seq_len > 2 && seq[2] == '~') if (seq_len > 2 && seq[2] == '~')
return KEY_DC; return KEY_DC;
break; break;
case '4': /* Esc [ 4 ~ == End on VT220/VT320/Linux case '4': /* Esc [ 4 ~ == End on VT220/VT320/
* console/xterm. */ * Linux console/xterm. */
if (seq_len > 2 && seq[2] == '~') if (seq_len > 2 && seq[2] == '~')
return KEY_END; return KEY_END;
break; break;
@ -1186,22 +1146,14 @@ int convert_sequence(const int *seq, size_t seq_len)
return KEY_DC; return KEY_DC;
case '@': /* Esc [ @ == Insert on Mach console. */ case '@': /* Esc [ @ == Insert on Mach console. */
return KEY_IC; return KEY_IC;
case 'A': /* Esc [ A == Up on ANSI/VT220/Linux case 'A': /* Esc [ A == Up on ANSI/VT220/Linux console/rxvt/
* console/FreeBSD console/Mach console/ * FreeBSD console/Mach console/Eterm/Terminal. */
* rxvt/Eterm/Terminal. */ case 'B': /* Esc [ B == Down on the same. */
case 'B': /* Esc [ B == Down on ANSI/VT220/Linux case 'C': /* Esc [ C == Right on the same. */
* console/FreeBSD console/Mach console/ case 'D': /* Esc [ D == Left on the same. */
* rxvt/Eterm/Terminal. */
case 'C': /* Esc [ C == Right on ANSI/VT220/Linux
* console/FreeBSD console/Mach console/
* rxvt/Eterm/Terminal. */
case 'D': /* Esc [ D == Left on ANSI/VT220/Linux
* console/FreeBSD console/Mach console/
* rxvt/Eterm/Terminal. */
return arrow_from_abcd(seq[1]); return arrow_from_abcd(seq[1]);
case 'E': /* Esc [ E == Center (5) on numeric keypad case 'E': /* Esc [ E == Center (5) on numeric keypad with
* with NumLock off on FreeBSD console/ * NumLock off on FreeBSD console/Terminal. */
* Terminal. */
return KEY_B2; return KEY_B2;
case 'F': /* Esc [ F == End on FreeBSD console/Eterm. */ case 'F': /* Esc [ F == End on FreeBSD console/Eterm. */
return KEY_END; return KEY_END;
@ -1265,20 +1217,15 @@ int convert_sequence(const int *seq, size_t seq_len)
case '[': case '[':
if (seq_len > 2 ) { if (seq_len > 2 ) {
switch (seq[2]) { switch (seq[2]) {
case 'A': /* Esc [ [ A == F1 on Linux case 'A': /* Esc [ [ A == F1 on Linux console. */
* console. */
return KEY_F(1); return KEY_F(1);
case 'B': /* Esc [ [ B == F2 on Linux case 'B': /* Esc [ [ B == F2 on Linux console. */
* console. */
return KEY_F(2); return KEY_F(2);
case 'C': /* Esc [ [ C == F3 on Linux case 'C': /* Esc [ [ C == F3 on Linux console. */
* console. */
return KEY_F(3); return KEY_F(3);
case 'D': /* Esc [ [ D == F4 on Linux case 'D': /* Esc [ [ D == F4 on Linux console. */
* console. */
return KEY_F(4); return KEY_F(4);
case 'E': /* Esc [ [ E == F5 on Linux case 'E': /* Esc [ [ E == F5 on Linux console. */
* console. */
return KEY_F(5); return KEY_F(5);
} }
} }