@@ -128,7 +128,9 @@ def convert_to_vk_code(self, key):
128128 except KeyError :
129129 try :
130130 key_int = int (key )
131- if 0 < key_int < 256 :
131+ ###XXX 241014-0223
132+ if 0 <= key_int < 256 :
133+ # if 0 < key_int < 256:
132134 return key_int
133135 except ValueError as error :
134136 print (error )
@@ -175,8 +177,9 @@ def extract_data_from_key(key_string):
175177 constraints = [self ._arg_manager .ALIAS_MAX_DELAY_IN_MS , self ._arg_manager .ALIAS_MIN_DELAY_IN_MS ]
176178
177179 # if string empty, stop
178- if key_string == '' :
179- return False
180+ ###XXX 241014-0223 to enable None ke with empty string
181+ # if key_string == '':
182+ # return False
180183
181184 # recognition of mofidiers +, -, !, ^
182185 # only interpret it as such when more then one char is in key
@@ -201,10 +204,7 @@ def extract_data_from_key(key_string):
201204
202205 # convert string to actual vk_code
203206 vk_code = self .convert_to_vk_code (key_string )
204- ###XXX None Key handling s up to prevent double eval of constraints and is always valid in trigger
205- if vk_code == 0 :
206- key_modifier == 'up'
207-
207+
208208 if key_modifier is None :
209209 new_element = (Key (vk_code , constraints = constraints , key_string = key_string ))
210210 elif key_modifier == 'down' :
@@ -230,7 +230,9 @@ def convert_key_string_group(list_of_strings, is_trigger_group = False):
230230 key_group .append (new_element )
231231 elif isinstance (new_element , Key ):
232232 key_press , key_releae = new_element .get_key_events ()
233- key_group .append (key_press )
233+ ###XXX hacks to enable empty ke with only one + element
234+ if new_element .vk_code > 0 :
235+ key_group .append (key_press )
234236 # if not in trigger group - so Key Instances as triggers are handled correctly
235237 if not is_trigger_group :
236238 key_group .append (key_releae )
@@ -746,8 +748,8 @@ def is_trigger_activated(current_ke, trigger_group):
746748 # to be not used to filter out opposing sim keys
747749 if alias_fired :
748750 self .state_manager .remove_key_press_state (current_ke .vk_code )
749- if CONSTANTS .DEBUG4 :
750- print (f"D4 : -- removed { current_ke } from pressed keys" )
751+ if CONSTANTS .DEBUG3 :
752+ print (f"D3 : -- removed { current_ke } from pressed keys" )
751753 if CONSTANTS .DEBUG4 :
752754 print (f"D4: { "-- | XX" if is_simulated else "XX" } SUPPRESSED: { current_ke } " )
753755
@@ -827,6 +829,8 @@ def check_debug_numpad_actions(self):
827829 CONSTANTS .DEBUG3 = not CONSTANTS .DEBUG3
828830 if self .check_for_combination (['num4' ]):
829831 CONSTANTS .DEBUG4 = not CONSTANTS .DEBUG4
832+ if self .check_for_combination (['num5' ]):
833+ self .display_internal_repr_groups ()
830834 if self .check_for_combination (['num7' ]):
831835 pprint .pp (f"real_key_state: { self .state_manager ._real_key_press_states_dict } " )
832836 pprint .pp (f"sim_key_state: { self .state_manager ._simulated_key_press_states_dict } " )
@@ -880,9 +884,9 @@ def reset_macro_sequence_by_alias(self, alias_name, current_ke = ''):
880884 try :
881885 macro_to_reset = self ._macros_alias_dict [alias_name ]
882886 macro_to_reset .reset_sequence_counter ()
883- print (f"--- Macro ({ alias_name } ) reseted successfully by { current_ke } " )
887+ if CONSTANTS .DEBUG4 :
888+ print (f"D4: -- Macro ({ alias_name } ) reseted successfully by { current_ke } " )
884889 except KeyError :
885-
886890 print (f"--- No Macro Sequence with name { alias_name } - reset failed" )
887891 if CONSTANTS .DEBUG :
888892 print (f"all sequence names: { self ._macros_alias_dict .keys ()} " )
0 commit comments