3 ms·
One key thing to know, is that typing a character with the Control key held into a CLI session (real or PTY) causes the TTY driver to receive an octet that look
by derefr 7y ago
One key thing to know, is that typing a character with the Control key held into a CLI session (real or PTY) causes the TTY driver to receive an octet that looks like that letter ANDed with ~0x40. In other words—referencing an ASCII table—you emit NUL by typing ^@, BEL by typing ^G, and so forth. ^H is literally BS (the ASCII backspace character.)
Another key thing to know, is that old pre-PS/2 keyboards actually emit these ASCII symbols, or something like them, directly, when you hit the appropriate key; and also do the appropriate Control-masking in hardware. When you hit the Backspace key on an IBM Model-M keyboard, it's sending 0x08 down the line. When you hit Control+H, it's also sending 0x08 down the line. The computer receiving these can't tell the difference (and, in fact, does not receive KeyDown/KeyUp signals for the Control key. It's not a "key" as such.)
And so, what's happening with the author's "cheat sheet", is that there's some particular key on these keyboards that has 0x5D ']' as its scancode; and, despite modern keyboards no longer doing Control-masking in hardware, the author's Terminal emulator is doing it in software, translating the key-chord of "the key with scancode 0x5D" + "control being held" into "the ASCII symbol 0x1D" (that's GS/Group Separator, for those wondering) and emitting that octet through the TTY driver into the telnet client, which receives it and treats it indistinguishably from someone who had typed Control+] on a US 101-key keyboard.