News for hackers. Stuff that matters.
Re:What happens when you press a key in your terminal? by jart on Thursday July 21, 2022 @04:31AM (#32177014)
I don't know if the chart helps, but

    #define CTRL(x) ((x) ^ 0100)
    // e.g. 'C' ^ 0100 is 3
    // e.g. '@' ^ 0100 is 0
    // e.g. 'M' ^ 0100 is 13 a.k.a. \r a.k.a. enter
I like this explanation better. It also explains what notation like ^C means. It's shorthand for 0100^C.
Re:What happens when you press a key in your terminal? by jagged-chisel on Thursday July 21, 2022 @09:38AM (#32179226)
Expanding your overloaded operator:

Crtl-C is shorthand for 0100 xor ‘C’

Also, the 0 prefix means this is a base-8 (octal) number