Fix ctrl input
This commit is contained in:
parent
d8e5ea3262
commit
9efbb4e227
|
@ -56,10 +56,8 @@ impl<I: Iterator<Item = Result<char, CharsError>>> Iterator for Keys<I> {
|
||||||
Some(Err(_)) | None => Key::Invalid,
|
Some(Err(_)) | None => Key::Invalid,
|
||||||
}),
|
}),
|
||||||
Some(Ok('\x7F')) => Some(Key::Backspace),
|
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' ... '\x1A')) => Some(Key::Ctrl((c as u8 - 0x1 + b'a') as char)),
|
||||||
Some(Ok(c @ '\x01' ... '\x04')) => 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)),
|
||||||
Some(Ok('\x06')) => Some(Key::Alt('f')),
|
|
||||||
Some(Ok(c)) => Some(Key::Char(c)),
|
Some(Ok(c)) => Some(Key::Char(c)),
|
||||||
None => None,
|
None => None,
|
||||||
Some(Err(_)) => Some(Key::Error),
|
Some(Err(_)) => Some(Key::Error),
|
||||||
|
|
Loading…
Reference in New Issue