fast-switch between display modes by holding DISP and pressing number keys -- doesn't work for 4 and 9 currently though?!

This commit is contained in:
Tristan Rowley
2020-02-29 19:22:43 +00:00
parent 2455df0f43
commit 952fbcc941
2 changed files with 11 additions and 0 deletions

View File

@@ -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

View File

@@ -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