diff options
author | David Walter Seikel | 2014-01-28 22:58:49 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-01-28 22:58:49 +1000 |
commit | d44de7f02897b51fbdcaf46b5545f3992afcf022 (patch) | |
tree | 04a83854f325a430e6883576a1dbffb970c0d916 | |
parent | Split out the line updating to it's own function. (diff) | |
download | boxes-d44de7f02897b51fbdcaf46b5545f3992afcf022.zip boxes-d44de7f02897b51fbdcaf46b5545f3992afcf022.tar.gz boxes-d44de7f02897b51fbdcaf46b5545f3992afcf022.tar.bz2 boxes-d44de7f02897b51fbdcaf46b5545f3992afcf022.tar.xz |
More escape sequence docs and clean ups.
-rw-r--r-- | boxes.c | 22 |
1 files changed, 9 insertions, 13 deletions
@@ -304,6 +304,7 @@ struct key | |||
304 | }; | 304 | }; |
305 | 305 | ||
306 | // This table includes some variations I have found on some terminals, and the MC "Esc digit" versions. | 306 | // This table includes some variations I have found on some terminals, and the MC "Esc digit" versions. |
307 | // http://rtfm.etla.org/xterm/ctlseq.html has a useful guide. | ||
307 | // TODO - Don't think I got all the linux console variations. | 308 | // TODO - Don't think I got all the linux console variations. |
308 | // TODO - Add more shift variations, plus Ctrl & Alt variations when needed. | 309 | // TODO - Add more shift variations, plus Ctrl & Alt variations when needed. |
309 | // TODO - tmux messes with the shift function keys somehow. | 310 | // TODO - tmux messes with the shift function keys somehow. |
@@ -395,7 +396,7 @@ struct key keys[] = | |||
395 | {"\x1B[23;2~", "Shift F11"}, | 396 | {"\x1B[23;2~", "Shift F11"}, |
396 | {"\x1B[24;2~", "Shift F12"}, | 397 | {"\x1B[24;2~", "Shift F12"}, |
397 | 398 | ||
398 | // Some terminals are special, and it seems they only have four function keys. | 399 | // "Normal" Some terminals are special, and it seems they only have four function keys. |
399 | {"\x1B[A", "Up"}, | 400 | {"\x1B[A", "Up"}, |
400 | {"\x1B[B", "Down"}, | 401 | {"\x1B[B", "Down"}, |
401 | {"\x1B[C", "Right"}, | 402 | {"\x1B[C", "Right"}, |
@@ -411,7 +412,7 @@ struct key keys[] = | |||
411 | {"\x1B[1;2R", "Shift F3"}, | 412 | {"\x1B[1;2R", "Shift F3"}, |
412 | {"\x1B[1;2S", "Shift F4"}, | 413 | {"\x1B[1;2S", "Shift F4"}, |
413 | 414 | ||
414 | // Not sure what this odd collection is. | 415 | // "Application" Esc O is known as SS3 |
415 | {"\x1BOA", "Up"}, | 416 | {"\x1BOA", "Up"}, |
416 | {"\x1BOB", "Down"}, | 417 | {"\x1BOB", "Down"}, |
417 | {"\x1BOC", "Right"}, | 418 | {"\x1BOC", "Right"}, |
@@ -427,7 +428,7 @@ struct key keys[] = | |||
427 | {"\x1BOR", "F3"}, | 428 | {"\x1BOR", "F3"}, |
428 | {"\x1BOS", "F4"}, | 429 | {"\x1BOS", "F4"}, |
429 | {"\x1BOT", "F5"}, | 430 | {"\x1BOT", "F5"}, |
430 | // These two conflict with the above four function key variation. | 431 | // These two conflict with the above four function key variations. |
431 | {"\x1B[R", "F6"}, | 432 | {"\x1B[R", "F6"}, |
432 | {"\x1B[S", "F7"}, | 433 | {"\x1B[S", "F7"}, |
433 | {"\x1B[T", "F8"}, | 434 | {"\x1B[T", "F8"}, |
@@ -437,16 +438,10 @@ struct key keys[] = | |||
437 | {"\x1B[X", "F12"}, | 438 | {"\x1B[X", "F12"}, |
438 | 439 | ||
439 | // Can't remember, but saw them somewhere. | 440 | // Can't remember, but saw them somewhere. |
440 | {"\x1B\x4f\x46", "End"}, | 441 | {"\x1BO1;2P", "Shift F1"}, |
441 | {"\x1B\x4f\x48", "Home"}, | 442 | {"\x1BO1;2Q", "Shift F2"}, |
442 | {"\x1B\x4F\x50", "F1"}, | 443 | {"\x1BO1;2R", "Shift F3"}, |
443 | {"\x1B\x4F\x51", "F2"}, | 444 | {"\x1BO1;2S", "Shift F4"}, |
444 | {"\x1B\x4F\x52", "F3"}, | ||
445 | {"\x1B\x4F\x53", "F4"}, | ||
446 | {"\x1B\x4f\x31;2P", "Shift F1"}, | ||
447 | {"\x1B\x4f\x31;2Q", "Shift F2"}, | ||
448 | {"\x1B\x4f\x31;2R", "Shift F3"}, | ||
449 | {"\x1B\x4f\x31;2S", "Shift F4"}, | ||
450 | 445 | ||
451 | // MC "Esc digit" specials. | 446 | // MC "Esc digit" specials. |
452 | // NOTE - The MC Esc variations might not be such a good idea, other programs want the Esc key for other things. | 447 | // NOTE - The MC Esc variations might not be such a good idea, other programs want the Esc key for other things. |
@@ -2708,6 +2703,7 @@ void boxes_main(void) | |||
2708 | moveCursorAbsolute(commandLine, 0, commandLine->content->lines.length, 0, 0); | 2703 | moveCursorAbsolute(commandLine, 0, commandLine->content->lines.length, 0, 0); |
2709 | 2704 | ||
2710 | // All the mouse tracking methods suck one way or another. sigh | 2705 | // All the mouse tracking methods suck one way or another. sigh |
2706 | // http://rtfm.etla.org/xterm/ctlseq.html documents xterm stuff, near the bottom is the mouse stuff. | ||
2711 | // http://leonerds-code.blogspot.co.uk/2012/04/wide-mouse-support-in-libvterm.html is helpful. | 2707 | // http://leonerds-code.blogspot.co.uk/2012/04/wide-mouse-support-in-libvterm.html is helpful. |
2712 | // Enable mouse (VT200 normal tracking mode, UTF8 encoding). The limit is 2015. Seems to only be in later xterms. | 2708 | // Enable mouse (VT200 normal tracking mode, UTF8 encoding). The limit is 2015. Seems to only be in later xterms. |
2713 | // printf("\x1B[?1005h"); | 2709 | // printf("\x1B[?1005h"); |