Add support for F1-F5 in the linux tty.
This commit is contained in:
IGI-111 2017-03-28 10:06:04 +02:00
parent 7401830c4f
commit bd9e4eb8e1
1 changed files with 4 additions and 0 deletions

View File

@ -146,6 +146,10 @@ fn parse_csi<I>(iter: &mut I) -> Option<Event>
where I: Iterator<Item = Result<u8, Error>> where I: Iterator<Item = Result<u8, Error>>
{ {
Some(match iter.next() { Some(match iter.next() {
Some(Ok(b'[')) => match iter.next() {
Some(Ok(val @ b'A'...b'E')) => Event::Key(Key::F(1 + val - b'A')),
_ => return None,
},
Some(Ok(b'D')) => Event::Key(Key::Left), Some(Ok(b'D')) => Event::Key(Key::Left),
Some(Ok(b'C')) => Event::Key(Key::Right), Some(Ok(b'C')) => Event::Key(Key::Right),
Some(Ok(b'A')) => Event::Key(Key::Up), Some(Ok(b'A')) => Event::Key(Key::Up),