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

Method handle_key_event

src/apps/cli/src/ui/provider_selector.rs:247–274  ·  view source on GitHub ↗
(&mut self, key: KeyEvent)

Source from the content-addressed store, hash-verified

245 // ── Key handling ──
246
247 pub fn handle_key_event(&mut self, key: KeyEvent) -> Option<ProviderSelection> {
248 if !self.visible {
249 return None;
250 }
251
252 match key.code {
253 KeyCode::Esc => {
254 self.hide();
255 None
256 }
257 KeyCode::Enter => {
258 let result = self.confirm_selection();
259 if result.is_some() {
260 self.hide();
261 }
262 result
263 }
264 KeyCode::Up => {
265 self.move_up();
266 None
267 }
268 KeyCode::Down => {
269 self.move_down();
270 None
271 }
272 _ => None,
273 }
274 }
275
276 // ── Mouse handling ──
277

Callers

nothing calls this directly

Calls 4

hideMethod · 0.45
confirm_selectionMethod · 0.45
move_upMethod · 0.45
move_downMethod · 0.45

Tested by

no test coverage detected