Skip to content

Commit

Permalink
Merge pull request #417 from wrh3c/Enable-Escape-button-and-fix-issue…
Browse files Browse the repository at this point in the history
…-400

Enable Esc key and fix issue 400
  • Loading branch information
BarbourSmith authored Sep 11, 2017
2 parents b1682ef + 4ae6162 commit a166260
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 4 additions & 1 deletion UIElements/gcodeCanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ def _on_keyboard_down(self, keyboard, keycode, text, modifiers):
if keycode[1] == self.data.config.get('Ground Control Settings', 'zoomIn'):
mat = Matrix().scale(1-scaleFactor, 1-scaleFactor, 1)
self.scatterInstance.apply_transform(mat, anchor)
return True # we handled this key - don't pass to other callbacks
elif keycode[1] == self.data.config.get('Ground Control Settings', 'zoomOut'):
mat = Matrix().scale(1+scaleFactor, 1+scaleFactor, 1)
self.scatterInstance.apply_transform(mat, anchor)
return True
return True # we handled this key - don't pass to other callbacks
else:
return False # we didn't handle this key - let next callback handle it

def isClose(self, a, b):
return abs(a-b) <= self.data.tolerance
Expand Down
8 changes: 1 addition & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'''
from kivy.config import Config
Config.set('input', 'mouse', 'mouse,disable_multitouch')
Config.set('kivy', 'exit_on_escape', '0')
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.floatlayout import FloatLayout
Expand Down Expand Up @@ -426,13 +427,6 @@ def on_config_change(self, config, section, key, value):
if (key == "truncate") or (key == "digits"):
self.frontpage.gcodecanvas.reloadGcode()



def close_settings(self, settings):
"""
Close settings panel
"""
super(GroundControlApp, self).close_settings(settings)

def push_settings_to_machine(self, *args):

Expand Down

0 comments on commit a166260

Please sign in to comment.