diff options
author | Alex Merry <alex.merry@cs.ox.ac.uk> | 2013-02-13 13:31:08 +0000 |
---|---|---|
committer | Alex Merry <alex.merry@cs.ox.ac.uk> | 2013-02-13 14:57:11 +0000 |
commit | 814372e88b23ce7956b2322d6f382742e2277ea5 (patch) | |
tree | c92167f83e2bfee10206c9b1fcf0494584cf92a8 /tikzit/src/gtk/GraphEditorPanel.m | |
parent | 0a7223674204a6e8ee311e226b2b5ddef88803a3 (diff) |
GTK: Add shortcuts for changing selection mode
Now when the graph has focus, shift+n will choose node selection,
shift+e edge selection and shift+b both.
Diffstat (limited to 'tikzit/src/gtk/GraphEditorPanel.m')
-rw-r--r-- | tikzit/src/gtk/GraphEditorPanel.m | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tikzit/src/gtk/GraphEditorPanel.m b/tikzit/src/gtk/GraphEditorPanel.m index 4c7312a..553f261 100644 --- a/tikzit/src/gtk/GraphEditorPanel.m +++ b/tikzit/src/gtk/GraphEditorPanel.m @@ -176,10 +176,21 @@ } - (void) keyPressed:(unsigned int)keyVal withMask:(InputMask)mask { - [app activateToolForKey:keyVal withMask:mask]; + if (![app activateToolForKey:keyVal withMask:mask]) { + id<Tool> tool = [panel activeTool]; + if ([panel hasTool] && [tool respondsToSelector:@selector(keyPressed:withMask:)]) { + [tool keyPressed:keyVal withMask:mask]; + } + } } - (void) keyReleased:(unsigned int)keyVal withMask:(InputMask)mask { + if (![app activateToolForKey:keyVal withMask:mask]) { + id<Tool> tool = [panel activeTool]; + if ([panel hasTool] && [tool respondsToSelector:@selector(keyReleased:withMask:)]) { + [tool keyReleased:keyVal withMask:mask]; + } + } } @end |