diff --git a/juci/config.json b/juci/config.json index 8a557f7..a97637f 100644 --- a/juci/config.json +++ b/juci/config.json @@ -31,16 +31,22 @@ ] }, "keybindings": { - "split_window": "s", "new_file": "n", "new_h_file": "h", - "new_cc_file": "c", - "close_tab": "w", + "new_cc_file": "c", "open_folder": "o", "open_file": "o", - "edit_undo": "z", "save": "s", "save_as": "s", + + "split_window": "s", + "close_tab": "w", + + "edit_copy": "c", + "edit_cut": "x", + "edit_paste": "v", + "edit_undo": "z", + "edit_find": "f", "compile_and_run": "r", "compile": "r" }, diff --git a/juci/notebook.cc b/juci/notebook.cc index 14ed7b8..45ba31f 100644 --- a/juci/notebook.cc +++ b/juci/notebook.cc @@ -78,7 +78,9 @@ void Notebook::Controller::CreateKeybindings(Keybindings::Controller }); keybindings.action_group_menu()-> add(Gtk::Action::create("EditFind", - Gtk::Stock::FIND), + "Find"), + Gtk::AccelKey(keybindings.config_ + .key_map()["edit_find"]), [this]() { is_new_file_ = false; OnEditSearch(); @@ -86,19 +88,26 @@ void Notebook::Controller::CreateKeybindings(Keybindings::Controller }); keybindings.action_group_menu()-> add(Gtk::Action::create("EditCopy", - Gtk::Stock::COPY), + "Copy"), + Gtk::AccelKey(keybindings.config_ + .key_map()["edit_copy"]), + [this]() { OnEditCopy(); }); keybindings.action_group_menu()-> add(Gtk::Action::create("EditCut", - Gtk::Stock::CUT), + "Cut"), + Gtk::AccelKey(keybindings.config_ + .key_map()["edit_cut"]), [this]() { OnEditCut(); }); keybindings.action_group_menu()-> add(Gtk::Action::create("EditPaste", - Gtk::Stock::PASTE), + "Paste"), + Gtk::AccelKey(keybindings.config_ + .key_map()["edit_paste"]), [this]() { OnEditPaste(); });