| 1 | //! Some code around handling events. |
| 2 | |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::syncrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/::mpscrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/mpsc/::Senderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/mpsc/Sender#; |
| 4 | |
| 5 | use crosstermrust-analyzer cargo crossterm 0.29.0 crate/::eventrust-analyzer cargo crossterm 0.29.0 event/::{KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#, KeyEventrust-analyzer cargo crossterm 0.29.0 event/KeyEvent#, KeyModifiersrust-analyzer cargo crossterm 0.29.0 event/KeyModifiers#, MouseEventrust-analyzer cargo crossterm 0.29.0 event/MouseEvent#, MouseEventKindrust-analyzer cargo crossterm 0.29.0 event/MouseEventKind#}; |
| 6 | |
| 7 | use craterust-analyzer cargo bottom 0.14.9 crate/::{ |
| 8 | apprust-analyzer cargo bottom 0.14.9 app/::{Apprust-analyzer cargo bottom 0.14.9 app/App#, layout_managerrust-analyzer cargo bottom 0.14.9 app/layout_manager/::WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#}, |
| 9 | collectionrust-analyzer cargo bottom 0.14.9 collection/::Datarust-analyzer cargo bottom 0.14.9 collection/Data#, |
| 10 | }; |
| 11 | |
| 12 | /// Events sent to the main thread. |
| 13 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 14 | pub enum BottomEventrust-analyzer cargo bottom 0.14.9 event/BottomEvent# { |
| 15 | Resizerust-analyzer cargo bottom 0.14.9 event/BottomEvent#Resize#, |
| 16 | KeyInputrust-analyzer cargo bottom 0.14.9 event/BottomEvent#KeyInput#(KeyEventrust-analyzer cargo crossterm 0.29.0 event/KeyEvent#), |
| 17 | MouseInputrust-analyzer cargo bottom 0.14.9 event/BottomEvent#MouseInput#(MouseEventrust-analyzer cargo crossterm 0.29.0 event/MouseEvent#), |
| 18 | PasteEventrust-analyzer cargo bottom 0.14.9 event/BottomEvent#PasteEvent#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 19 | Updaterust-analyzer cargo bottom 0.14.9 event/BottomEvent#Update#(Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<Datarust-analyzer cargo bottom 0.14.9 collection/Data#>), |
| 20 | Cleanrust-analyzer cargo bottom 0.14.9 event/BottomEvent#Clean#, |
| 21 | Terminaterust-analyzer cargo bottom 0.14.9 event/BottomEvent#Terminate#, |
| 22 | } |
| 23 | |
| 24 | /// Events sent to the collection thread. |
| 25 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 26 | pub enum CollectionThreadEventrust-analyzer cargo bottom 0.14.9 event/CollectionThreadEvent# { |
| 27 | Resetrust-analyzer cargo bottom 0.14.9 event/CollectionThreadEvent#Reset#, |
| 28 | } |
| 29 | |
| 30 | /// Handle a [`MouseEvent`]. |
| 31 | pub fn handle_mouse_eventrust-analyzer cargo bottom 0.14.9 event/handle_mouse_event().(event: MouseEventrust-analyzer cargo crossterm 0.29.0 event/MouseEvent#, app: &mut Apprust-analyzer cargo bottom 0.14.9 app/App#) { |
| 32 | match event.kindrust-analyzer cargo crossterm 0.29.0 event/MouseEvent#kind. { |
| 33 | MouseEventKindrust-analyzer cargo crossterm 0.29.0 event/MouseEventKind#::ScrollUprust-analyzer cargo crossterm 0.29.0 event/MouseEventKind#ScrollUp# => app.handle_scroll_uprust-analyzer cargo bottom 0.14.9 app/impl#[App]handle_scroll_up().(), |
| 34 | MouseEventKindrust-analyzer cargo crossterm 0.29.0 event/MouseEventKind#::ScrollDownrust-analyzer cargo crossterm 0.29.0 event/MouseEventKind#ScrollDown# => app.handle_scroll_downrust-analyzer cargo bottom 0.14.9 app/impl#[App]handle_scroll_down().(), |
| 35 | MouseEventKindrust-analyzer cargo crossterm 0.29.0 event/MouseEventKind#::Downrust-analyzer cargo crossterm 0.29.0 event/MouseEventKind#Down#(button) => { |
| 36 | let (x, y) = (event.columnrust-analyzer cargo crossterm 0.29.0 event/MouseEvent#column., event.rowrust-analyzer cargo crossterm 0.29.0 event/MouseEvent#row.); |
| 37 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().app.app_config_fieldsrust-analyzer cargo bottom 0.14.9 app/App#app_config_fields..disable_clickrust-analyzer cargo bottom 0.14.9 app/AppConfigFields#disable_click. { |
| 38 | match button { |
| 39 | crosstermrust-analyzer cargo crossterm 0.29.0 crate/::eventrust-analyzer cargo crossterm 0.29.0 event/::MouseButtonrust-analyzer cargo crossterm 0.29.0 event/MouseButton#::Leftrust-analyzer cargo crossterm 0.29.0 event/MouseButton#Left# => { |
| 40 | // Trigger left click widget activity |
| 41 | app.on_left_mouse_uprust-analyzer cargo bottom 0.14.9 app/impl#[App]on_left_mouse_up().(x, y); |
| 42 | } |
| 43 | crosstermrust-analyzer cargo crossterm 0.29.0 crate/::eventrust-analyzer cargo crossterm 0.29.0 event/::MouseButtonrust-analyzer cargo crossterm 0.29.0 event/MouseButton#::Rightrust-analyzer cargo crossterm 0.29.0 event/MouseButton#Right# => {} |
| 44 | _ => {} |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | _ => {} |
| 49 | }; |
| 50 | } |
| 51 | |
| 52 | /// Handle a [`KeyEvent`]. |
| 53 | pub fn handle_key_event_or_breakrust-analyzer cargo bottom 0.14.9 event/handle_key_event_or_break().( |
| 54 | event: KeyEventrust-analyzer cargo crossterm 0.29.0 event/KeyEvent#, app: &mut Apprust-analyzer cargo bottom 0.14.9 app/App#, reset_sender: &Senderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/mpsc/Sender#<CollectionThreadEventrust-analyzer cargo bottom 0.14.9 event/CollectionThreadEvent#>, |
| 55 | ) -> bool { |
| 56 | // c_debug!("KeyEvent: {event:?}"); |
| 57 | |
| 58 | if event.modifiersrust-analyzer cargo crossterm 0.29.0 event/KeyEvent#modifiers..is_emptyrust-analyzer cargo crossterm 0.29.0 event/impl#[KeyModifiers]is_empty().() { |
| 59 | match event.coderust-analyzer cargo crossterm 0.29.0 event/KeyEvent#code. { |
| 60 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('q') | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('Q') if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().app.is_in_any_searchrust-analyzer cargo bottom 0.14.9 app/impl#[App]is_in_any_search().() => return true, |
| 61 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Endrust-analyzer cargo crossterm 0.29.0 event/KeyCode#End# => app.skip_to_lastrust-analyzer cargo bottom 0.14.9 app/impl#[App]skip_to_last().(), |
| 62 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Homerust-analyzer cargo crossterm 0.29.0 event/KeyCode#Home# => app.skip_to_firstrust-analyzer cargo bottom 0.14.9 app/impl#[App]skip_to_first().(), |
| 63 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Uprust-analyzer cargo crossterm 0.29.0 event/KeyCode#Up# => app.on_up_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_up_key().(), |
| 64 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Downrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Down# => app.on_down_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_down_key().(), |
| 65 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Leftrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Left# => app.on_left_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_left_key().(), |
| 66 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Rightrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Right# => app.on_right_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_right_key().(), |
| 67 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#(' ') if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().app.is_in_search_widgetrust-analyzer cargo bottom 0.14.9 app/impl#[App]is_in_search_widget().() => app.on_space_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_space_key().(), |
| 68 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#(caught_char) => app.on_char_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_char_key().(caught_char), |
| 69 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Escrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Esc# => app.on_escrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_esc().(), |
| 70 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Enterrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Enter# => app.on_enterrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_enter().(), |
| 71 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Tabrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Tab# => app.on_tabrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_tab().(), |
| 72 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Backspacerust-analyzer cargo crossterm 0.29.0 event/KeyCode#Backspace# => app.on_backspacerust-analyzer cargo bottom 0.14.9 app/impl#[App]on_backspace().(), |
| 73 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Deleterust-analyzer cargo crossterm 0.29.0 event/KeyCode#Delete# => app.on_deleterust-analyzer cargo bottom 0.14.9 app/impl#[App]on_delete().(), |
| 74 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Frust-analyzer cargo crossterm 0.29.0 event/KeyCode#F#(1) => app.toggle_ignore_caserust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_ignore_case().(), |
| 75 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Frust-analyzer cargo crossterm 0.29.0 event/KeyCode#F#(2) => app.toggle_search_whole_wordrust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_search_whole_word().(), |
| 76 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Frust-analyzer cargo crossterm 0.29.0 event/KeyCode#F#(3) => app.toggle_search_regexrust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_search_regex().(), |
| 77 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Frust-analyzer cargo crossterm 0.29.0 event/KeyCode#F#(5) => app.toggle_tree_moderust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_tree_mode().(), |
| 78 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Frust-analyzer cargo crossterm 0.29.0 event/KeyCode#F#(6) => app.toggle_sort_menurust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_sort_menu().(), |
| 79 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Frust-analyzer cargo crossterm 0.29.0 event/KeyCode#F#(9) => app.kill_current_processrust-analyzer cargo bottom 0.14.9 app/impl#[App]kill_current_process().(), |
| 80 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::PageDownrust-analyzer cargo crossterm 0.29.0 event/KeyCode#PageDown# => app.on_page_downrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_page_down().(), |
| 81 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::PageUprust-analyzer cargo crossterm 0.29.0 event/KeyCode#PageUp# => app.on_page_uprust-analyzer cargo bottom 0.14.9 app/impl#[App]on_page_up().(), |
| 82 | _ => {} |
| 83 | } |
| 84 | } else { |
| 85 | // Otherwise, track the modifier as well... |
| 86 | if let KeyModifiersrust-analyzer cargo crossterm 0.29.0 event/KeyModifiers#::ALTrust-analyzer cargo crossterm 0.29.0 event/impl#[KeyModifiers]ALT. = event.modifiersrust-analyzer cargo crossterm 0.29.0 event/KeyEvent#modifiers. { |
| 87 | match event.coderust-analyzer cargo crossterm 0.29.0 event/KeyEvent#code. { |
| 88 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('c') | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('C') => app.toggle_ignore_caserust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_ignore_case().(), |
| 89 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('w') | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('W') => app.toggle_search_whole_wordrust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_search_whole_word().(), |
| 90 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('r') | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('R') => app.toggle_search_regexrust-analyzer cargo bottom 0.14.9 app/impl#[App]toggle_search_regex().(), |
| 91 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('h') => app.on_left_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_left_key().(), |
| 92 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('l') => app.on_right_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_right_key().(), |
| 93 | _ => {} |
| 94 | } |
| 95 | } else if let KeyModifiersrust-analyzer cargo crossterm 0.29.0 event/KeyModifiers#::CONTROLrust-analyzer cargo crossterm 0.29.0 event/impl#[KeyModifiers]CONTROL. = event.modifiersrust-analyzer cargo crossterm 0.29.0 event/KeyEvent#modifiers. { |
| 96 | if event.coderust-analyzer cargo crossterm 0.29.0 event/KeyEvent#code. rust-analyzer cargo crossterm 0.29.0 event/impl#[KeyCode][`PartialEq<Self>`]eq().==rust-analyzer cargo crossterm 0.29.0 event/impl#[KeyCode][`PartialEq<Self>`]eq(). rust-analyzer cargo crossterm 0.29.0 event/impl#[KeyCode][`PartialEq<Self>`]eq().KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('c') { |
| 97 | return true; |
| 98 | } |
| 99 | |
| 100 | match event.coderust-analyzer cargo crossterm 0.29.0 event/KeyEvent#code. { |
| 101 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('f') => app.on_slashrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_slash().(), |
| 102 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Leftrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Left# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Leftrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Left#), |
| 103 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Rightrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Right# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Rightrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Right#), |
| 104 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Uprust-analyzer cargo crossterm 0.29.0 event/KeyCode#Up# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Uprust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Up#), |
| 105 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Downrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Down# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Downrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Down#), |
| 106 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('r') if reset_sender.sendrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/mpsc/impl#[`Sender<T>`]send().(CollectionThreadEventrust-analyzer cargo bottom 0.14.9 event/CollectionThreadEvent#::Resetrust-analyzer cargo bottom 0.14.9 event/CollectionThreadEvent#Reset#).is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() => { |
| 107 | app.resetrust-analyzer cargo bottom 0.14.9 app/impl#[App]reset().(); |
| 108 | } |
| 109 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('a') => app.skip_cursor_beginningrust-analyzer cargo bottom 0.14.9 app/impl#[App]skip_cursor_beginning().(), |
| 110 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('e') => app.skip_cursor_endrust-analyzer cargo bottom 0.14.9 app/impl#[App]skip_cursor_end().(), |
| 111 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('u') if app.is_in_any_searchrust-analyzer cargo bottom 0.14.9 app/impl#[App]is_in_any_search().() => app.clear_searchrust-analyzer cargo bottom 0.14.9 app/impl#[App]clear_search().(), |
| 112 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('w') => app.clear_previous_wordrust-analyzer cargo bottom 0.14.9 app/impl#[App]clear_previous_word().(), |
| 113 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('h') => app.on_backspacerust-analyzer cargo bottom 0.14.9 app/impl#[App]on_backspace().(), |
| 114 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('d') => app.scroll_half_page_downrust-analyzer cargo bottom 0.14.9 app/impl#[App]scroll_half_page_down().(), |
| 115 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('u') => app.scroll_half_page_uprust-analyzer cargo bottom 0.14.9 app/impl#[App]scroll_half_page_up().(), |
| 116 | // KeyCode::Char('j') => {}, // Move down |
| 117 | // KeyCode::Char('k') => {}, // Move up |
| 118 | // KeyCode::Char('h') => {}, // Move right |
| 119 | // KeyCode::Char('l') => {}, // Move left |
| 120 | // Can't do now, CTRL+BACKSPACE doesn't work and graphemes |
| 121 | // are hard to iter while truncating last (eloquently). |
| 122 | // KeyCode::Backspace => app.skip_word_backspace(), |
| 123 | _ => {} |
| 124 | } |
| 125 | } else if let KeyModifiersrust-analyzer cargo crossterm 0.29.0 event/KeyModifiers#::SHIFTrust-analyzer cargo crossterm 0.29.0 event/impl#[KeyModifiers]SHIFT. = event.modifiersrust-analyzer cargo crossterm 0.29.0 event/KeyEvent#modifiers. { |
| 126 | match event.coderust-analyzer cargo crossterm 0.29.0 event/KeyEvent#code. { |
| 127 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Leftrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Left# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Leftrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Left#), |
| 128 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Rightrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Right# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Rightrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Right#), |
| 129 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Uprust-analyzer cargo crossterm 0.29.0 event/KeyCode#Up# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Uprust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Up#), |
| 130 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Downrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Down# => app.move_widget_selectionrust-analyzer cargo bottom 0.14.9 app/impl#[App]move_widget_selection().(&WidgetDirectionrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#::Downrust-analyzer cargo bottom 0.14.9 app/layout_manager/WidgetDirection#Down#), |
| 131 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#('Q') if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().app.is_in_any_searchrust-analyzer cargo bottom 0.14.9 app/impl#[App]is_in_any_search().() => return true, |
| 132 | KeyCoderust-analyzer cargo crossterm 0.29.0 event/KeyCode#::Charrust-analyzer cargo crossterm 0.29.0 event/KeyCode#Char#(caught_char) => app.on_char_keyrust-analyzer cargo bottom 0.14.9 app/impl#[App]on_char_key().(caught_char), |
| 133 | _ => {} |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | false |
| 139 | } |