diff --git a/user_input/numpad_input.py b/user_input/numpad_input.py index 43a47a2..77d70da 100644 --- a/user_input/numpad_input.py +++ b/user_input/numpad_input.py @@ -29,10 +29,7 @@ class NumpadInput(object): if event.char is 's': event.char = self.on_0_key_press() - numbers = "jklmnopqrs" - if self.data.is_display_held and event.char in numbers: - self.actions.call_method_name("set_display_mode_%s"%self.data.get_display_modes_list()[numbers.index(event.char)]) - elif event.char in numpad: + if event.char in numpad: self.run_action_for_mapped_key(event.char) else: print('{} is not in keypad map'.format(event.char)) @@ -68,6 +65,10 @@ class NumpadInput(object): is_function = 1 else: is_function = 0 + + numbers = "jklmnopqrs" + if self.data.is_display_held and key in numbers: + return self.actions.call_method_name("set_display_mode_%s"%self.data.get_display_modes_list()[numbers.index(key)]) print('the numpad action being called is {} (mode is {})'.format(this_mapping[mode][is_function], mode)) if value != -1: @@ -101,7 +102,7 @@ class NumpadInput(object): if(not self.in_0_event ): self.in_0_event = True self.additional_0_in_event = 0 - self.root.after(600, self.check_event_outcome) + self.root.after(60, self.check_event_outcome) else: self.additional_0_in_event = self.additional_0_in_event + 1 @@ -114,7 +115,7 @@ class NumpadInput(object): self.run_action_for_mapped_key('n') elif(self.additional_0_in_event == 1): print('this doesnt happen - may not be needed') - self.root.after(600, self.second_check_event_outcome) + self.root.after(60, self.second_check_event_outcome) def second_check_event_outcome(self): if(self.additional_0_in_event == 1 ):