From f97a43f5464ea866b1210e0ce50292f8249f2ff1 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 17 Mar 2013 22:48:41 +0100 Subject: host/simu: add keyboard shortcut for Jack and Play --- host/simu/inter/inter_node.py | 4 +++- host/simu/view/switch.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'host/simu') diff --git a/host/simu/inter/inter_node.py b/host/simu/inter/inter_node.py index 39b858f2..1c6b653a 100644 --- a/host/simu/inter/inter_node.py +++ b/host/simu/inter/inter_node.py @@ -53,8 +53,10 @@ class InterNode (Inter): self.step_size_scale.pack () self.play_var = IntVar () self.play_button = Checkbutton (self.right_frame, - variable = self.play_var, text = 'Play', command = self.play) + variable = self.play_var, text = 'Play', command = self.play, + underline = 0) self.play_button.pack () + self.bind_all ('p', lambda event: self.play_button.invoke ()) def step (self): """Do a step. Signal to the Hub we are ready to wait to the next step diff --git a/host/simu/view/switch.py b/host/simu/view/switch.py index 445cbd02..138bbdc6 100644 --- a/host/simu/view/switch.py +++ b/host/simu/view/switch.py @@ -33,6 +33,10 @@ class Switch: self.button = Checkbutton (frame, variable = self.var, command = self.__update, text = text, indicatoron = False) self.button.pack () + if text == 'Jack': + self.button.configure (underline = 0) + frame.bind_all ('j', lambda event: self.button.invoke (), + add = '+') self.model = model self.__update () -- cgit v1.2.3