MCPcopy Create free account
hub / github.com/GCWing/BitFun / handle_key_event

Method handle_key_event

src/apps/cli/src/ui/question.rs:210–227  ·  view source on GitHub ↗

Handle a key event. Returns a QuestionAction.

(&mut self, key: KeyEvent)

Source from the content-addressed store, hash-verified

208
209 /// Handle a key event. Returns a QuestionAction.
210 pub fn handle_key_event(&mut self, key: KeyEvent) -> QuestionAction {
211 if key.kind != KeyEventKind::Press && key.kind != KeyEventKind::Repeat {
212 return QuestionAction::None;
213 }
214
215 // Custom text editing mode
216 if self.editing_custom && !self.on_confirm_page() {
217 return self.handle_editing_key(key);
218 }
219
220 // Confirm page
221 if self.on_confirm_page() {
222 return self.handle_confirm_key(key);
223 }
224
225 // Normal question selection
226 self.handle_question_key(key)
227 }
228
229 /// Handle keys when editing custom "Other" text
230 fn handle_editing_key(&mut self, key: KeyEvent) -> QuestionAction {

Calls 4

on_confirm_pageMethod · 0.80
handle_editing_keyMethod · 0.80
handle_confirm_keyMethod · 0.80
handle_question_keyMethod · 0.80

Tested by

no test coverage detected