]> git.donarmstrong.com Git - kiibohd-kll.git/commitdiff
Adding support for kll 0.3d
authorJacob Alexander <haata@kiibohd.com>
Sat, 17 Oct 2015 22:00:17 +0000 (15:00 -0700)
committerJacob Alexander <haata@kiibohd.com>
Sat, 17 Oct 2015 22:08:34 +0000 (15:08 -0700)
- Adding brightness control hid extension http://www.usb.org/developers/hidpage/HUTRR41.pdf
- Adding next keyboard layout support http://www.usb.org/developers/hidpage/HUTRR56B_Application_Keyboard_Layout_Selector.pdf

backends/kiibohd.py
kll_lib/hid_dict.py

index 09b6dca4245c5d13727a880f5ec353548eb0d380..d4f1e55ab3d2d22e582c120c6f2c4ee8b2684c62 100644 (file)
@@ -181,7 +181,11 @@ class Backend( BackendBase ):
                                                                tag = resultItem[1][ arg ].split( '_', 1 )[1]
                                                                if '_' in tag:
                                                                        tag = tag.replace( '_', '' )
-                                                               lookupNum = kll_hid_lookup_dictionary['ConsCode'][ tag ][1]
+                                                               try:
+                                                                       lookupNum = kll_hid_lookup_dictionary['ConsCode'][ tag ][1]
+                                                               except KeyError as err:
+                                                                       print ( "{0} {1} Consumer HID kll bug...please report.".format( ERROR, err ) )
+                                                                       raise
                                                                byteForm = lookupNum.to_bytes( 2, byteorder='little' ) # XXX Yes, little endian from how the uC structs work
                                                                self.fill_dict['ResultMacros'] += "{0}, {1}, ".format( *byteForm )
                                                                continue
index b27aa4fb4a1b74cb818fee07ed1b7fa1a8f65458..41cd45e8c1d868cb1a5e63ca2d451c9a90655481 100644 (file)
@@ -331,7 +331,15 @@ hid_lookup_dictionary = dict([
        ( ('CONS', 0x064), 'CONSUMER_BROADCAST_MODE' ),
        ( ('CONS', 0x065), 'CONSUMER_SNAPSHOT' ),
        ( ('CONS', 0x066), 'CONSUMER_STILL' ),
-# 0x067 - 0x07F Reserved
+# 0x067 - 0x06E Reserved?
+       ( ('CONS', 0x06F), 'CONSUMER_BRIGHTNESS_INCREMENT' ),
+       ( ('CONS', 0x070), 'CONSUMER_BRIGHTNESS_DECREMENT' ),
+
+       ( ('CONS', 0x072), 'CONSUMER_BACKLIGHT_TOGGLE' ),
+       ( ('CONS', 0x073), 'CONSUMER_BRIGHTNESS_MIN' ),
+       ( ('CONS', 0x074), 'CONSUMER_BRIGHTNESS_MAX' ),
+       ( ('CONS', 0x075), 'CONSUMER_BRIGHTNESS_AUTO' ),
+# 0x076 - 0x07F Reserved
 
        ( ('CONS', 0x081), 'CONSUMER_ASSIGN_SELECTION' ),
        ( ('CONS', 0x082), 'CONSUMER_MODE_STEP' ),
@@ -659,7 +667,8 @@ hid_lookup_dictionary = dict([
        ( ('CONS', 0x29A), 'AC_SPLIT' ),
        ( ('CONS', 0x29B), 'AC_DISTRIBUTE_HORIZONTALLY' ),
        ( ('CONS', 0x29C), 'AC_DISTRIBUTE_VERTICALLY' ),
-# 0x29D-0xFFFF Reserved
+       ( ('CONS', 0x29D), 'AC_NEXT_KEYBOARD_LAYOUT_SEL' ),
+# 0x29E-0xFFFF Reserved
 
        # USB HID LED Codes
        ( ('LED', 0x00), 'LED_UNDEFINED' ),
@@ -1227,7 +1236,15 @@ kll_hid_lookup_dictionary['ConsCode'] = dict([
        ( 'BROADCASTMODE', ('CONS', 0x064) ),
        ( 'SNAPSHOT', ('CONS', 0x065) ),
        ( 'STILL', ('CONS', 0x066) ),
-# 0x067 - 0x07F Reserved
+# 0x067 - 0x06E Reserved?
+       ( 'BRIGHTNESSINCREMENT', ('CONS', 0x06F) ),
+       ( 'BRIGHTNESSDECREMENT', ('CONS', 0x070) ),
+
+       ( 'BACKLIGHTTOGGLE', ('CONS', 0x072) ),
+       ( 'BRIGHTNESSMIN', ('CONS', 0x073) ),
+       ( 'BRIGHTNESSMAX', ('CONS', 0x074) ),
+       ( 'BRIGHTNESSAUTO', ('CONS', 0x075) ),
+# 0x076 - 0x07F Reserved
 
        ( 'ASSIGNSELECTION', ('CONS', 0x081) ),
        ( 'MODESTEP', ('CONS', 0x082) ),
@@ -1557,6 +1574,7 @@ kll_hid_lookup_dictionary['ConsCode'] = dict([
        ( 'SPLIT', ('CONS', 0x29A) ),
        ( 'DISTRIBUTEHORIZONTALLY', ('CONS', 0x29B) ),
        ( 'DISTRIBUTEVERTICALLY', ('CONS', 0x29C) ),
-# 0x29D-0xFFFF Reserved
+       ( 'NEXTKEYBOARDLAYOUTSELECT', ('CONS', 0x29D) ),
+# 0x29E-0xFFFF Reserved
 ])