MCPcopy Create free account
hub / github.com/Autoparallel/learner / handle_normal_input

Method handle_normal_input

crates/learnerd/src/tui/state.rs:351–393  ·  view source on GitHub ↗

Handles input during normal operation (no dialog active). Supports: - Vim-style navigation (h,j,k,l) - Arrow key navigation - Pane switching - PDF opening - Quit command

(&mut self, key: KeyCode)

Source from the content-addressed store, hash-verified

349 /// - PDF opening
350 /// - Quit command
351 fn handle_normal_input(&mut self, key: KeyCode) -> bool {
352 match key {
353 KeyCode::Char('q') => {
354 self.dialog = DialogType::ExitConfirm;
355 self.needs_redraw = true;
356 false
357 },
358 // Pane switching
359 KeyCode::Left | KeyCode::Char('h') => {
360 if self.focused_pane == FocusedPane::Details {
361 self.focused_pane = FocusedPane::List;
362 self.needs_redraw = true;
363 }
364 false
365 },
366 KeyCode::Right | KeyCode::Char('l') => {
367 if self.focused_pane == FocusedPane::List {
368 self.focused_pane = FocusedPane::Details;
369 self.needs_redraw = true;
370 }
371 false
372 },
373 // Navigation
374 KeyCode::Up | KeyCode::Char('k') => {
375 self.handle_up_navigation();
376 false
377 },
378 KeyCode::Down | KeyCode::Char('j') => {
379 self.handle_down_navigation();
380 false
381 },
382 KeyCode::Char('o') => {
383 self.handle_open_pdf();
384 false
385 },
386 KeyCode::Char(':') => {
387 self.dialog = DialogType::CommandInput;
388 self.needs_redraw = true;
389 false
390 },
391 _ => false,
392 }
393 }
394
395 /// Handles upward navigation in both list and details views.
396 fn handle_up_navigation(&mut self) {

Callers 1

handle_inputMethod · 0.80

Calls 3

handle_up_navigationMethod · 0.80
handle_open_pdfMethod · 0.80

Tested by

no test coverage detected