aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
AgeCommit message (Collapse)Author
2016-07-04Correctly handle Backspace and DeleteJoe Wilm
The default characters sent for this were incorrect. Delete now sends xterm-compatible escapes (dch1, kdch1), and Backspace sends the delete code 0x7f.
2016-07-02Move WriteNotifier type into input moduleJoe Wilm
It's a generic impl of `input::Notify` for `Write` types; as such, it seems completely reasonable to include in the input module. Moving it also serves to declutter main.
2016-06-29Add license headers to source filesJoe Wilm
2016-06-23Function keys send escape sequencesJoe Wilm
This doesn't currently handle any of the modifiers, but it does mean applications like `htop` can be used.
2016-06-23Implement special input handlingJoe Wilm
There's a number of keys/combinations that should emit escape sequences to the PTY when triggered. This commit adds a framework to support that. The input::Processor is a type which tracks state of modifier keys. When special keys (like arrow, function) are detected, the processor pulls up a list of candidate escapes to send, and picks the first one based on terminal mode and active modifier keys. The input::Processor is generic over the thing receiving the escape sequences, the input::Notify type. Included is a wrapper for `&mut io::Write` which implements input::Notify and is currently used to connect the processor to the PTY stream. This added handling of the APP_CURSOR mode which changes affects input processing.