Fix control character usage

This commit is contained in:
Jeremy Soller 2022-10-19 11:33:35 -06:00
parent 07a832efd4
commit edc0631df6
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
3 changed files with 82 additions and 74 deletions

View file

@ -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)) => {

View file

@ -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]);