diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index ca87db6..33c2036 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,8 +8,53 @@ mod tui; use eyre::Result; +use app_action::AppAction; +use keys::key_commands::KeyCommand; + fn main() -> Result<()> { + tui::install_hooks()?; let mut app = app::App::new(std::time::Duration::from_millis(10))?; + let mut key_commands = vec![ + // Status bar + KeyCommand { + key_code: "o".to_string(), + description: "Open new link".to_string(), + action: AppAction::OpenUrl, + }, + + // Navigation + KeyCommand { + key_code: "g".to_string(), + description: "Scroll to top".to_string(), + action: AppAction::ScrollTop, + }, + KeyCommand { + key_code: "G".to_string(), + description: "Scroll to bottom".to_string(), + action: AppAction::ScrollBottom, + }, + KeyCommand { + key_code: "k".to_string(), + description: "Scroll up one line".to_string(), + action: AppAction::ScrollUp, + }, + KeyCommand { + key_code: "j".to_string(), + description: "Scroll down one line".to_string(), + action: AppAction::ScrollDown, + }, + KeyCommand { + key_code: "q".to_string(), + description: "Quit molehole".to_string(), + action: AppAction::Quit, + }, + KeyCommand { + key_code: "?".to_string(), + description: "Show help menu".to_string(), + action: AppAction::ShowHelpMenu + } + ]; + app.key_commands.append(&mut key_commands); app.run() } |