device: clear out fields for empty persistent remappable action

This commit is contained in:
Peter F. Patel-Schneider 2022-04-30 07:12:34 -04:00
parent afa91b57c8
commit 97dca3d8f3
1 changed files with 2 additions and 0 deletions

View File

@ -727,6 +727,8 @@ class KeysArrayPersistent(KeysArray):
remapped = special_keys.HORIZONTAL_SCROLL[remapped]
elif actionId == special_keys.ACTIONID.Consumer:
remapped = special_keys.HID_CONSUMERCODES[remapped]
elif actionId == special_keys.ACTIONID.Empty: # purge data from empty value
remapped = modifiers = status = 0
self.keys[index] = PersistentRemappableAction(self.device, index, key, actionId, remapped, modifiers, status)
elif _log.isEnabledFor(_WARNING):
_log.warn(f"Key with index {index} was expected to exist but device doesn't report it.")