settings: fix small bugs found from testing
This commit is contained in:
parent
6f613b17c7
commit
4fd75a64ff
|
@ -555,13 +555,12 @@ class KeysArrayPersistent(KeysArray):
|
||||||
keydata = self.device.feature_request(FEATURE.PERSISTENT_REMAPPABLE_ACTION, 0x20, index, 0xFF)
|
keydata = self.device.feature_request(FEATURE.PERSISTENT_REMAPPABLE_ACTION, 0x20, index, 0xFF)
|
||||||
if keydata:
|
if keydata:
|
||||||
key = _unpack("!H", keydata[:2])[0]
|
key = _unpack("!H", keydata[:2])[0]
|
||||||
try:
|
mapped_data = self.device.feature_request(
|
||||||
mapped_data = self.device.feature_request(
|
FEATURE.PERSISTENT_REMAPPABLE_ACTION, 0x30, key & 0xFF00, key & 0xFF, 0xFF
|
||||||
FEATURE.PERSISTENT_REMAPPABLE_ACTION, 0x30, key & 0xFF00, key & 0xFF, 0xFF
|
)
|
||||||
)
|
if mapped_data:
|
||||||
if mapped_data:
|
_ignore, _ignore, actionId, remapped, modifiers, status = _unpack("!HBBHBB", mapped_data[:8])
|
||||||
_ignore, _ignore, actionId, remapped, modifiers, status = _unpack("!HBBHBB", mapped_data[:8])
|
else:
|
||||||
except Exception:
|
|
||||||
actionId = remapped = modifiers = status = 0
|
actionId = remapped = modifiers = status = 0
|
||||||
actionId = special_keys.ACTIONID[actionId]
|
actionId = special_keys.ACTIONID[actionId]
|
||||||
if actionId == special_keys.ACTIONID.Key:
|
if actionId == special_keys.ACTIONID.Key:
|
||||||
|
|
|
@ -388,7 +388,7 @@ class Backlight3(_Setting):
|
||||||
label = _("Backlight")
|
label = _("Backlight")
|
||||||
description = _("Set illumination time for keyboard.")
|
description = _("Set illumination time for keyboard.")
|
||||||
feature = _F.BACKLIGHT3
|
feature = _F.BACKLIGHT3
|
||||||
rw_options = {"read_fnid": 0x10, "write_fnid": 0x20, "suffix": 0x09}
|
rw_options = {"read_fnid": 0x10, "write_fnid": 0x20, "suffix": b"\x09"}
|
||||||
validator_class = _RangeV
|
validator_class = _RangeV
|
||||||
min_value = 0
|
min_value = 0
|
||||||
max_value = 1000
|
max_value = 1000
|
||||||
|
|
Loading…
Reference in New Issue