settings: add setting for M-Key LEDs
This commit is contained in:
parent
856f40e789
commit
faf905de9c
|
@ -986,6 +986,33 @@ class Gesture2Params(_LongSettings):
|
||||||
return cls(items, sub_items)
|
return cls(items, sub_items)
|
||||||
|
|
||||||
|
|
||||||
|
class MKeyLEDs(_BitFieldSetting):
|
||||||
|
name = 'm-key-leds'
|
||||||
|
label = _('M-Key LEDs')
|
||||||
|
description = _('Control the M-Key LEDs.')
|
||||||
|
feature = _F.MKEYS
|
||||||
|
choices_universe = _NamedInts()
|
||||||
|
for i in range(8):
|
||||||
|
choices_universe[1 << i] = 'M' + str(i + 1)
|
||||||
|
_labels = {k: (None, _('Lights up the %s key.') % k) for k in choices_universe}
|
||||||
|
print('MKEYS CHOICES UNIVERSE', choices_universe, _labels)
|
||||||
|
|
||||||
|
class rw_class(_FeatureRW):
|
||||||
|
def __init__(self, feature):
|
||||||
|
super().__init__(feature, write_fnid=0x10)
|
||||||
|
|
||||||
|
def read(self, device): # no way to read, so just assume off
|
||||||
|
return b'\x00'
|
||||||
|
|
||||||
|
class validator_class(_BitFieldV):
|
||||||
|
@classmethod
|
||||||
|
def build(cls, setting_class, device):
|
||||||
|
number = device.feature_request(setting_class.feature, 0x00)[0]
|
||||||
|
options = [setting_class.choices_universe[1 << i] for i in range(number)]
|
||||||
|
print('NUMBER OF MKEYS', number, options)
|
||||||
|
return cls(options) if options else None
|
||||||
|
|
||||||
|
|
||||||
SETTINGS = [
|
SETTINGS = [
|
||||||
RegisterHandDetection, # simple
|
RegisterHandDetection, # simple
|
||||||
RegisterSmoothScroll, # simple
|
RegisterSmoothScroll, # simple
|
||||||
|
@ -1015,7 +1042,8 @@ SETTINGS = [
|
||||||
DisableKeyboardKeys, # working
|
DisableKeyboardKeys, # working
|
||||||
DivertCrown, # working
|
DivertCrown, # working
|
||||||
CrownSmooth, # working
|
CrownSmooth, # working
|
||||||
DivertGkeys,
|
DivertGkeys, # working
|
||||||
|
MKeyLEDs,
|
||||||
Multiplatform, # working
|
Multiplatform, # working
|
||||||
DualPlatform, # simple
|
DualPlatform, # simple
|
||||||
ChangeHost, # working
|
ChangeHost, # working
|
||||||
|
|
Loading…
Reference in New Issue