… | |
… | |
66 | SET UP Home |
66 | SET UP Home |
67 | BACKSPACE Rubout |
67 | BACKSPACE Rubout |
68 | CAPS LOCK Prior/PgUp |
68 | CAPS LOCK Prior/PgUp |
69 | NO SCROLL Next/PgDown |
69 | NO SCROLL Next/PgDown |
70 | BREAK End |
70 | BREAK End |
|
|
71 | CTRL-C Insert |
71 | |
72 | |
72 | Set-Up Guide: |
73 | Set-Up Guide: |
73 | |
74 | |
74 | http://vt100.net/docs/vt102-ug/chapter3.html#S3.6 |
75 | http://vt100.net/docs/vt102-ug/chapter3.html#S3.6 |
75 | |
76 | |
… | |
… | |
598 | "\x1e" => 0x24 | 0x100, # CTRL-~ |
599 | "\x1e" => 0x24 | 0x100, # CTRL-~ |
599 | "\x1f" => 0x75 | 0x100, # CTRL-? |
600 | "\x1f" => 0x75 | 0x100, # CTRL-? |
600 | |
601 | |
601 | # hardcoded rxvt keys |
602 | # hardcoded rxvt keys |
602 | "\e" => 0x2a, # ESC |
603 | "\e" => 0x2a, # ESC |
|
|
604 | "\e[2~" => 0x79 | 0x100, # CTRL-C (insert) |
603 | "\e[3~" => 0x03, # DC |
605 | "\e[3~" => 0x03, # DC |
604 | "\e[5~" => 0x7e, # CAPS LOCK (prior) |
606 | "\e[5~" => 0x7e, # CAPS LOCK (prior) |
605 | "\e[6~" => 0x6a, # NO SCROLL (next) |
607 | "\e[6~" => 0x6a, # NO SCROLL (next) |
606 | "\e[A" => 0x30, # UP |
608 | "\e[A" => 0x30, # UP |
607 | "\e[B" => 0x22, # DOWN |
609 | "\e[B" => 0x22, # DOWN |
… | |
… | |
614 | "\e[7~" => 0x7b, # SETUP (home) |
616 | "\e[7~" => 0x7b, # SETUP (home) |
615 | "\e[8~" => 0x23, # BREAK (end) |
617 | "\e[8~" => 0x23, # BREAK (end) |
616 | "\e[8\$" => 0x23 | 0x080, # SHIFT BREAK / DISCONNECT (shift-end) |
618 | "\e[8\$" => 0x23 | 0x080, # SHIFT BREAK / DISCONNECT (shift-end) |
617 | "\x7f" => 0x33, # BACKSPACE |
619 | "\x7f" => 0x33, # BACKSPACE |
618 | |
620 | |
619 | "\e[11~" => 0x32, # F1 |
621 | "\e[11~" => 0x32, # PF1 |
620 | "\e[11~" => 0x42, # F2 |
622 | "\e[12~" => 0x42, # PF2 |
621 | "\e[11~" => 0x31, # F3 |
623 | "\e[13~" => 0x31, # PF3 |
622 | "\e[11~" => 0x41, # F4 |
624 | "\e[14~" => 0x41, # PF4 |
623 | ); |
625 | ); |
624 | |
626 | |
625 | @KEYMAP{map chr, 0x20 .. 0x40, 0x5b .. 0x7e} = unpack "C*", pack "H*", |
627 | @KEYMAP{map chr, 0x20 .. 0x40, 0x5b .. 0x7e} = unpack "C*", pack "H*", |
626 | "779ad5a9a8b8a755a6b5b6b466256575" . "351a3929283837273626d656e634e5f5" . "b9" # 20..40 |
628 | "779ad5a9a8b8a755a6b5b6b466256575" . "351a3929283837273626d656e634e5f5" . "b9" # 20..40 |
627 | . "154514b7a5" . "244a6879591949485816574746766706" . "050a185a0817780969077a95c594a4"; # 5b..7e |
629 | . "154514b7a5" . "244a6879591949485816574746766706" . "050a185a0817780969077a95c594a4"; # 5b..7e |
… | |
… | |
656 | # skip input we can't decipher |
658 | # skip input we can't decipher |
657 | substr $STDIN_BUF, 0, 1, ""; |
659 | substr $STDIN_BUF, 0, 1, ""; |
658 | } |
660 | } |
659 | |
661 | |
660 | if ($KBD) { |
662 | if ($KBD) { |
661 | system "stty -icanon -icrnl -inlcr -echo min 1 time 0"; |
663 | system "stty -icanon -icrnl -inlcr -echo min 1 time 0"; # -isig |
662 | eval q{ sub END { system "stty sane" } }; |
664 | eval q{ sub END { system "stty sane" } }; |
663 | $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = sub { exit 1 }; |
665 | $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = sub { exit 1 }; |
664 | } |
666 | } |
665 | |
667 | |
666 | ############################################################################# |
668 | ############################################################################# |
… | |
… | |
777 | # things we do from time to time only |
779 | # things we do from time to time only |
778 | unless ($CLK & 0xf) { |
780 | unless ($CLK & 0xf) { |
779 | # do I/O |
781 | # do I/O |
780 | |
782 | |
781 | unless ($CLK & 0xfff) { |
783 | unless ($CLK & 0xfff) { |
782 | if (select $x = $RIN, undef, undef, $POWERSAVE < 10 ? 0 : $CURSOR_IS_ON && 10) { |
784 | if (select $x = $RIN, undef, undef, $POWERSAVE < 10 ? 0 : $CURSOR_IS_ON && 3600) { |
783 | |
785 | |
784 | # pty/serial I/O |
786 | # pty/serial I/O |
785 | if ($PTY && (vec $x, fileno $PTY, 1) && (@PUSARTRECV < 128) && !@KQUEUE) { |
787 | if ($PTY && (vec $x, fileno $PTY, 1) && (@PUSARTRECV < 128) && !@KQUEUE) { |
786 | sysread $PTY, my $buf, 256; |
788 | sysread $PTY, my $buf, 256; |
787 | |
789 | |
788 | # linux don't do cs7 and/or parity anymore, so we need to filter # out xoff characters to avoid freezes. |
790 | # linux don't do cs7 and/or parity anymore, so we need to filter |
|
|
791 | # out xoff characters to avoid freezes. |
789 | push @PUSARTRECV, grep { ($_ & 0x7f) != 0x13 } unpack "C*", $buf; |
792 | push @PUSARTRECV, grep { ($_ & 0x7f) != 0x13 } unpack "C*", $buf; |
790 | } |
793 | } |
791 | |
794 | |
792 | # keyboard input |
795 | # keyboard input |
793 | if ($KBD && (vec $x, 0, 1)) { |
796 | if ($KBD && (vec $x, 0, 1)) { |