From a2b5f0f77e3615fdb8380c0bd31e4a338ecef8ad Mon Sep 17 00:00:00 2001 From: Mike Walters Date: Tue, 27 Aug 2024 16:33:57 +0100 Subject: [PATCH] Add keyboard shortcuts --- src/ui.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui.rs b/src/ui.rs index 79a9f68b..a7a19949 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -395,6 +395,12 @@ pub fn activate(application: &Application) -> Result<(), Error> { .build(); window.add_action_entries([open_action, save_action, scan_action, capture_action, stop_action]); + application.set_accels_for_action("win.open", &["o"]); + application.set_accels_for_action("win.save", &["s"]); + application.set_accels_for_action("win.scan", &["r", "F5"]); + application.set_accels_for_action("win.capture", &["b"]); + application.set_accels_for_action("win.stop", &["e"]); + let action_bar = gtk::ActionBar::new(); let open_button = gtk::Button::builder()