Fix ctrl input

This commit is contained in:
Ticki 2016-03-10 15:21:11 +01:00
parent d8e5ea3262
commit 9efbb4e227
1 changed files with 1 additions and 3 deletions

View File

@ -56,10 +56,8 @@ impl<I: Iterator<Item = Result<char, CharsError>>> Iterator for Keys<I> {
Some(Err(_)) | None => Key::Invalid,
}),
Some(Ok('\x7F')) => Some(Key::Backspace),
Some(Ok(c @ '\x10' ... '\x1A')) => Some(Key::Ctrl((c as u8 - 0x10 + b'p') as char)),
Some(Ok(c @ '\x01' ... '\x04')) => Some(Key::Ctrl((c as u8 - 0x1 + b'a') as char)),
Some(Ok(c @ '\x01' ... '\x1A')) => Some(Key::Ctrl((c as u8 - 0x1 + b'a') as char)),
Some(Ok(c @ '\x1C' ... '\x1F')) => Some(Key::Ctrl((c as u8 - 0x1C + b'4') as char)),
Some(Ok('\x06')) => Some(Key::Alt('f')),
Some(Ok(c)) => Some(Key::Char(c)),
None => None,
Some(Err(_)) => Some(Key::Error),