Fix bug in Keys

This commit is contained in:
Ticki 2016-03-10 21:57:42 +01:00
parent 2335596a1a
commit 7145651a83
1 changed files with 2 additions and 0 deletions

View File

@ -55,6 +55,8 @@ impl<I: Iterator<Item = Result<char, CharsError>>> Iterator for Keys<I> {
Some(Ok(c)) => Key::Alt(c), Some(Ok(c)) => Key::Alt(c),
Some(Err(_)) | None => Key::Invalid, Some(Err(_)) | None => Key::Invalid,
}), }),
Some(Ok('\n')) | Some(Ok('\r')) => Some(Key::Char('\n')),
Some(Ok('\t')) => Some(Key::Char('\t')),
Some(Ok('\x7F')) => Some(Key::Backspace), Some(Ok('\x7F')) => Some(Key::Backspace),
Some(Ok(c @ '\x01' ... '\x1A')) => 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(c @ '\x1C' ... '\x1F')) => Some(Key::Ctrl((c as u8 - 0x1C + b'4') as char)),