Add '\r' back for the KeyEvent::Enter (#239)
This commit is contained in:
parent
4952cb33d9
commit
60cd12710a
@ -98,6 +98,7 @@ pub enum KeyEvent {
|
||||
End,
|
||||
PageUp,
|
||||
PageDown,
|
||||
Tab,
|
||||
BackTab,
|
||||
Delete,
|
||||
Insert,
|
||||
|
@ -266,8 +266,8 @@ where
|
||||
None => InputEvent::Keyboard(KeyEvent::Esc),
|
||||
}
|
||||
}
|
||||
b'\n' => InputEvent::Keyboard(KeyEvent::Enter),
|
||||
b'\t' => InputEvent::Keyboard(KeyEvent::Char('\t')),
|
||||
b'\r' | b'\n' => InputEvent::Keyboard(KeyEvent::Enter),
|
||||
b'\t' => InputEvent::Keyboard(KeyEvent::Tab),
|
||||
b'\x7F' => InputEvent::Keyboard(KeyEvent::Backspace),
|
||||
c @ b'\x01'..=b'\x1A' => {
|
||||
InputEvent::Keyboard(KeyEvent::Ctrl((c as u8 - 0x1 + b'a') as char))
|
||||
|
@ -397,7 +397,7 @@ fn parse_key_event_record(key_event: &KeyEventRecord) -> Option<KeyEvent> {
|
||||
if character == '\t' {
|
||||
Some(KeyEvent::BackTab)
|
||||
} else {
|
||||
Some(KeyEvent::Char(character))
|
||||
Some(KeyEvent::Tab)
|
||||
}
|
||||
} else {
|
||||
Some(KeyEvent::Char(character))
|
||||
|
Loading…
Reference in New Issue
Block a user