@@ -17,9 +17,11 @@ use super::{handle_exit, show_popup};
1717
1818pub ( super ) fn main_handler ( key_event : KeyEvent , app : & mut App ) {
1919 match key_event. code {
20- // exit application on ESC
21- KeyCode :: Esc => {
22- handle_exit ( app) ;
20+ // exit application on ESC or Q
21+ KeyCode :: Esc | KeyCode :: Char ( 'q' | 'Q' ) => {
22+ if app. focus != Focus :: SearchBar {
23+ handle_exit ( app) ;
24+ }
2325 }
2426 // exit application on Ctrl-D
2527 KeyCode :: Char ( 'd' | 'D' | 'c' ) => {
@@ -38,21 +40,15 @@ pub(super) fn main_handler(key_event: KeyEvent, app: &mut App) {
3840 ) ;
3941 }
4042 }
41- // exit application on Q
42- KeyCode :: Char ( 'q' | 'Q' ) => {
43- if app. focus != Focus :: SearchBar {
44- handle_exit ( app) ;
45- }
46- }
4743
4844 // Move into the table
49- KeyCode :: Up => {
45+ KeyCode :: Up | KeyCode :: Char ( 'k' ) => {
5046 app. print_percentage = true ;
5147 app. current_page = Main ;
5248 app. table . previous ( ) ;
5349 }
5450
55- KeyCode :: Down => {
51+ KeyCode :: Down | KeyCode :: Char ( 'j' ) => {
5652 app. print_percentage = true ;
5753 app. current_page = Main ;
5854 app. table . next ( ) ;
@@ -68,19 +64,19 @@ pub(super) fn main_handler(key_event: KeyEvent, app: &mut App) {
6864 handle_counter_switch ( app, false ) ;
6965 }
7066
71- KeyCode :: Char ( 'k' | 'K ') => handle_switch_page ( app, Qrcode ) ,
67+ KeyCode :: Char ( ' ' ) => handle_switch_page ( app, Qrcode ) ,
7268
73- KeyCode :: Char ( 'i' | 'I ') => {
69+ KeyCode :: Char ( '? ' ) => {
7470 let info_text = String :: from (
7571 "
7672 Press:
7773 d -> Delete selected code
7874 + -> Increment the HOTP counter
7975 - -> Decrement the HOTP counter
80- k -> Show QRCode of the selected element
76+ Space -> Show QRCode of the selected element
8177 Enter -> Copy the OTP Code to the clipboard
82- CTRL-F -> Search codes
83- CTRL-W -> Clear the search query
78+ CTRL-F | '/' -> Search codes
79+ CTRL-W | CTRL-U -> Clear the search query
8480 q, CTRL-D, Esc -> Exit the application
8581 " ,
8682 ) ;
0 commit comments