diff --git a/lib/logitech_receiver/diversion.py b/lib/logitech_receiver/diversion.py index 8652814a..b9c368ab 100644 --- a/lib/logitech_receiver/diversion.py +++ b/lib/logitech_receiver/diversion.py @@ -1495,51 +1495,52 @@ def evaluate_rules(feature, notification: HIDPPNotification, device): rules.evaluate(feature, notification, device, True) -# process a notification -def process_notification(device, notification: HIDPPNotification, feature): +def process_notification(device, notification: HIDPPNotification, feature) -> None: + """Processes HID++ notifications.""" global keys_down, g_keys_down, m_keys_down, mr_key_down, key_down, key_up, thumb_wheel_displacement key_down, key_up = None, None # need to keep track of keys that are down to find a new key down - if feature == FEATURE.REPROG_CONTROLS_V4 and notification.address == 0x00: - new_keys_down = struct.unpack("!4H", notification.data[:8]) - for key in new_keys_down: - if key and key not in keys_down: - key_down = key - for key in keys_down: - if key and key not in new_keys_down: - key_up = key - keys_down = new_keys_down - # and also G keys down - elif feature == FEATURE.GKEY and notification.address == 0x00: - new_g_keys_down = struct.unpack("