From 952fbcc941dc461e05b686fbc28f931d73e2c6e8 Mon Sep 17 00:00:00 2001 From: Tristan Rowley Date: Sat, 29 Feb 2020 19:22:43 +0000 Subject: [PATCH] fast-switch between display modes by holding DISP and pressing number keys -- doesn't work for 4 and 9 currently though?! --- data_centre/data.py | 1 + user_input/numpad_input.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/data_centre/data.py b/data_centre/data.py index 0dce385..eb3751e 100644 --- a/data_centre/data.py +++ b/data_centre/data.py @@ -57,6 +57,7 @@ class Data(object): ### state data self.auto_repeat_on = True self.function_on = False + self.is_display_held = False self.display_mode = "SAMPLER" self.control_mode = 'PLAYER' self.bank_number = 0 diff --git a/user_input/numpad_input.py b/user_input/numpad_input.py index 845697d..43a47a2 100644 --- a/user_input/numpad_input.py +++ b/user_input/numpad_input.py @@ -21,10 +21,17 @@ class NumpadInput(object): def on_key_press(self, event): numpad = list(string.ascii_lowercase[0:19]) + if event.char is 'h': # DISP button + self.data.is_display_held = True + if event.char is '.' or event.char is 'z': self.actions.quit_the_program() 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: self.run_action_for_mapped_key(event.char) else: @@ -35,6 +42,9 @@ class NumpadInput(object): if event.char in numpad: self.check_key_release_settings(event.char) + if event.char is 'h': + self.data.is_display_held = False + def on_mouse_move(self, event): if self.data.settings['user_input']['MOUSE_INPUT']['value'] != 'enabled': return