mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 11:20:15 +01:00
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:
@@ -57,6 +57,7 @@ class Data(object):
|
|||||||
### state data
|
### state data
|
||||||
self.auto_repeat_on = True
|
self.auto_repeat_on = True
|
||||||
self.function_on = False
|
self.function_on = False
|
||||||
|
self.is_display_held = False
|
||||||
self.display_mode = "SAMPLER"
|
self.display_mode = "SAMPLER"
|
||||||
self.control_mode = 'PLAYER'
|
self.control_mode = 'PLAYER'
|
||||||
self.bank_number = 0
|
self.bank_number = 0
|
||||||
|
|||||||
@@ -21,10 +21,17 @@ class NumpadInput(object):
|
|||||||
def on_key_press(self, event):
|
def on_key_press(self, event):
|
||||||
numpad = list(string.ascii_lowercase[0:19])
|
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':
|
if event.char is '.' or event.char is 'z':
|
||||||
self.actions.quit_the_program()
|
self.actions.quit_the_program()
|
||||||
if event.char is 's':
|
if event.char is 's':
|
||||||
event.char = self.on_0_key_press()
|
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:
|
elif event.char in numpad:
|
||||||
self.run_action_for_mapped_key(event.char)
|
self.run_action_for_mapped_key(event.char)
|
||||||
else:
|
else:
|
||||||
@@ -35,6 +42,9 @@ class NumpadInput(object):
|
|||||||
if event.char in numpad:
|
if event.char in numpad:
|
||||||
self.check_key_release_settings(event.char)
|
self.check_key_release_settings(event.char)
|
||||||
|
|
||||||
|
if event.char is 'h':
|
||||||
|
self.data.is_display_held = False
|
||||||
|
|
||||||
def on_mouse_move(self, event):
|
def on_mouse_move(self, event):
|
||||||
if self.data.settings['user_input']['MOUSE_INPUT']['value'] != 'enabled':
|
if self.data.settings['user_input']['MOUSE_INPUT']['value'] != 'enabled':
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user