diff options
author | Alex Merry <dev@randomguy3.me.uk> | 2013-03-22 15:59:02 +0000 |
---|---|---|
committer | Alex Merry <dev@randomguy3.me.uk> | 2013-03-22 15:59:02 +0000 |
commit | ce114d1100efb2c7635227e2aa1a5b738bc54b1f (patch) | |
tree | 8cd0582f01af471540f615ef2e1aab141f6d2a93 /tikzit/src/gtk/GraphEditorPanel.m | |
parent | c27208f7a1051dcd5fa9c042d3eb87ae9a42f28f (diff) |
Add "space" shortcut to refresh preview without it grabbing focus
Diffstat (limited to 'tikzit/src/gtk/GraphEditorPanel.m')
-rw-r--r-- | tikzit/src/gtk/GraphEditorPanel.m | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tikzit/src/gtk/GraphEditorPanel.m b/tikzit/src/gtk/GraphEditorPanel.m index 553f261..a1c63a2 100644 --- a/tikzit/src/gtk/GraphEditorPanel.m +++ b/tikzit/src/gtk/GraphEditorPanel.m @@ -24,6 +24,8 @@ #import "TikzDocument.h" #import "WidgetSurface.h" +#import <gdk/gdkkeysyms.h> + @class GraphRenderer; @class WidgetSurface; @@ -176,6 +178,9 @@ } - (void) keyPressed:(unsigned int)keyVal withMask:(InputMask)mask { + if (keyVal == GDK_KEY_space && !mask) { + return; + } if (![app activateToolForKey:keyVal withMask:mask]) { id<Tool> tool = [panel activeTool]; if ([panel hasTool] && [tool respondsToSelector:@selector(keyPressed:withMask:)]) { @@ -185,6 +190,9 @@ } - (void) keyReleased:(unsigned int)keyVal withMask:(InputMask)mask { + if (keyVal == GDK_KEY_space && !mask) { + [app previewDocument:[panel document]]; + } if (![app activateToolForKey:keyVal withMask:mask]) { id<Tool> tool = [panel activeTool]; if ([panel hasTool] && [tool respondsToSelector:@selector(keyReleased:withMask:)]) { |