Merge pull request #100 from IGI-111/linux-function-keys

fix #99
This commit is contained in:
ticki 2017-03-29 16:11:35 +02:00 committed by GitHub
commit d86a6b2d9b
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),