Fix control character usage
This commit is contained in:
parent
07a832efd4
commit
edc0631df6
3 changed files with 82 additions and 74 deletions
|
|
@ -231,14 +231,6 @@ where
|
|||
buffer.action(TextAction::Down);
|
||||
return Status::Captured;
|
||||
},
|
||||
KeyCode::Backspace => {
|
||||
buffer.action(TextAction::Backspace);
|
||||
return Status::Captured;
|
||||
},
|
||||
KeyCode::Delete => {
|
||||
buffer.action(TextAction::Delete);
|
||||
return Status::Captured;
|
||||
},
|
||||
KeyCode::Home => {
|
||||
buffer.action(TextAction::Home);
|
||||
return Status::Captured;
|
||||
|
|
@ -255,6 +247,18 @@ where
|
|||
buffer.action(TextAction::PageDown);
|
||||
return Status::Captured;
|
||||
},
|
||||
KeyCode::Enter => {
|
||||
buffer.action(TextAction::Enter);
|
||||
return Status::Captured;
|
||||
},
|
||||
KeyCode::Backspace => {
|
||||
buffer.action(TextAction::Backspace);
|
||||
return Status::Captured;
|
||||
},
|
||||
KeyCode::Delete => {
|
||||
buffer.action(TextAction::Delete);
|
||||
return Status::Captured;
|
||||
},
|
||||
_ => ()
|
||||
},
|
||||
Event::Keyboard(KeyEvent::CharacterReceived(character)) => {
|
||||
|
|
|
|||
|
|
@ -164,12 +164,13 @@ fn main() {
|
|||
orbclient::K_RIGHT if event.pressed => buffer.action(TextAction::Right),
|
||||
orbclient::K_UP if event.pressed => buffer.action(TextAction::Up),
|
||||
orbclient::K_DOWN if event.pressed => buffer.action(TextAction::Down),
|
||||
orbclient::K_BKSP if event.pressed => buffer.action(TextAction::Backspace),
|
||||
orbclient::K_DEL if event.pressed => buffer.action(TextAction::Delete),
|
||||
orbclient::K_HOME if event.pressed => buffer.action(TextAction::Home),
|
||||
orbclient::K_END if event.pressed => buffer.action(TextAction::End),
|
||||
orbclient::K_PGUP if event.pressed => buffer.action(TextAction::PageUp),
|
||||
orbclient::K_PGDN if event.pressed => buffer.action(TextAction::PageDown),
|
||||
orbclient::K_ENTER if event.pressed => buffer.action(TextAction::Enter),
|
||||
orbclient::K_BKSP if event.pressed => buffer.action(TextAction::Backspace),
|
||||
orbclient::K_DEL if event.pressed => buffer.action(TextAction::Delete),
|
||||
orbclient::K_0 if event.pressed && ctrl_pressed => {
|
||||
font_size_i = font_size_default;
|
||||
buffer.set_metrics(font_sizes[font_size_i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue