Commit 0473ab4
Consume key strokes in key bindings
Changed files (2)
Diff
@@ -75,7 +75,8 @@ public class AbstractMenu : GLib.Object { return null; } - public void process_key_binding_events (uint keyval) {+ /** @return true if the keybindings consumes the event. */+ public bool process_key_binding_events (uint keyval) { string display; FontDisplay current_display = MainWindow.get_current_display (); ToolItem tm;@@ -96,7 +97,7 @@ public class AbstractMenu : GLib.Object { if (!SettingsDisplay.update_key_bindings && !(item is ToolItem)) { item.action ();- return;+ return true; } if (item is ToolItem) {@@ -106,16 +107,18 @@ public class AbstractMenu : GLib.Object { if (tm.tool.editor_events) { MainWindow.get_toolbox ().set_current_tool (tm.tool); tm.tool.select_action (tm.tool);- return;+ return true; } else { tm.tool.select_action (tm.tool); - return;+ return true; } } } } } }+ + return false; } public void load_key_bindings () {@@ -144,8 +144,12 @@ public class TabContent : GLib.Object { KeyBindings.add_modifier_from_keyval (keyval); if (!text_input_visible) {- MainWindow.get_menu ().process_key_binding_events (keyval);- GlyphCanvas.current_display.key_press (keyval);+ AbstractMenu menu = MainWindow.get_menu ();+ bool consumed = menu.process_key_binding_events (keyval);+ + if (!consumed) {+ GlyphCanvas.current_display.key_press (keyval);+ } } else { text_input.key_press (keyval); }