Input events/key parsing: please add better documentation where hard-coded values come from for educational purposes
Hi. In https://gitlab.redox-os.org/redox-os/termion/-/blob/master/src/event.rs#L131 you have lots of important yet hard to understand parsing code for input keys. Especially the "CTRL-"-sequences are hard to understand. Can you maybe add a comment where/in what specification these values can be found for educational reasons? Please be more specific than "ANSI escape sequences".
c @ b'\x01'..=b'\x1A' => Ok(Event::Key(Key::Ctrl((c as u8 - 0x1 + b'a') as char))), c @ b'\x1C'..=b'\x1F' => Ok(Event::Key(Key::Ctrl((c as u8 - 0x1C + b'4') as char))),
- why two ranges for
- why substract something from
- why add after that