changeset 70:1f35f83485e1

Adding support for kll 0.3d - 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
author Jacob Alexander <haata@kiibohd.com>
date Sat, 17 Oct 2015 15:00:17 -0700
parents 29fe0a9799ec
children 0900675f02ee a5107b668c4b
files backends/kiibohd.py kll_lib/hid_dict.py
diffstat 2 files changed, 27 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/backends/kiibohd.py	Mon Oct 12 23:27:34 2015 -0700
+++ b/backends/kiibohd.py	Sat Oct 17 15:00:17 2015 -0700
@@ -181,7 +181,11 @@
 								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
--- a/kll_lib/hid_dict.py	Mon Oct 12 23:27:34 2015 -0700
+++ b/kll_lib/hid_dict.py	Sat Oct 17 15:00:17 2015 -0700
@@ -331,7 +331,15 @@
 	( ('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 @@
 	( ('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 @@
 	( '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 @@
 	( 'SPLIT', ('CONS', 0x29A) ),
 	( 'DISTRIBUTEHORIZONTALLY', ('CONS', 0x29B) ),
 	( 'DISTRIBUTEVERTICALLY', ('CONS', 0x29C) ),
-# 0x29D-0xFFFF Reserved
+	( 'NEXTKEYBOARDLAYOUTSELECT', ('CONS', 0x29D) ),
+# 0x29E-0xFFFF Reserved
 ])