cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 HID keyboard descriptor (USAGE ID codes)

MPano.1
Associate

Hello. I'm trying to implement a laptop keyboard on a microcontroller. I can not find usb codes for some fn buttons. The usb protocol has descriptions for combinations of changing the display brightness, volume, media keys, but more is needed. Can someone tell me where to find usb codes for disable touchpad or enable airplane mode? Here is my HID descriptor for the keyboard.

			    0x05, 0x01,                    //   USAGE_PAGE (Generic Desktop)
			    0x09, 0x06,                    //   USAGE (Keyboard)
			    0xa1, 0x01,                    //   COLLECTION (Application)
				0x85, 0x01,       			   //   Report ID (1)
			    0x05, 0x07,                    //   USAGE_PAGE (Keyboard)
			    0x19, 0xe0,                    //   USAGE_MINIMUM (Keyboard LeftControl)
			    0x29, 0xe7,                    //   USAGE_MAXIMUM (Keyboard Right GUI)
			    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
			    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
			    0x75, 0x01,                    //   REPORT_SIZE (1)
			    0x95, 0x08,                    //   REPORT_COUNT (8)
			    0x81, 0x02,                    //   INPUT (Data,Var,Abs)
			    0x95, 0x01,                    //   REPORT_COUNT (1)
			    0x75, 0x08,                    //   REPORT_SIZE (8)
			    0x81, 0x03,                    //   INPUT (Cnst,Var,Abs)
			    0x95, 0x05,                    //   REPORT_COUNT (5)
			    0x75, 0x01,                    //   REPORT_SIZE (1)
			    0x05, 0x08,                    //   USAGE_PAGE (LEDs)
			    0x19, 0x01,                    //   USAGE_MINIMUM (Num Lock)
			    0x29, 0x05,                    //   USAGE_MAXIMUM (Kana)
			    0x91, 0x02,                    //   OUTPUT (Data,Var,Abs)
			    0x95, 0x01,                    //   REPORT_COUNT (1)
			    0x75, 0x03,                    //   REPORT_SIZE (3)
			    0x91, 0x03,                    //   OUTPUT (Cnst,Var,Abs)
			    0x95, 0x06,                    //   REPORT_COUNT (6)
			    0x75, 0x08,                    //   REPORT_SIZE (8)
			    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
			    0x25, 0x65,                    //   LOGICAL_MAXIMUM (101)
			    0x05, 0x07,                    //   USAGE_PAGE (Keyboard)
			    0x19, 0x00,                    //   USAGE_MINIMUM (Reserved (no event indicated))
			    0x29, 0x65,                    //   USAGE_MAXIMUM (Keyboard Application)
			    0x81, 0x00,                    //   INPUT (Data,Ary,Abs)
			    0xc0,                          //   END_COLLECTION 65
				0x05, 0x0C,        			   //   Usage Page (Consumer)
				0x09, 0x01,                    //   Usage (Consumer Control)
				0xA1, 0x01,                    //   Collection (Application)
				0x85, 0x02,                    //   Report ID (2)
				0x05, 0x0C,                    //   Usage Page (Consumer)
				0x15, 0x00,                    //   Logical Minimum (0)
				0x25, 0x01,                    //   Logical Maximum (1)
				0x75, 0x01,                    //   Report Size (1)
				0x95, 0x08,                    //   Report Count (8)
				0x09, 0x6F,                    //   Brightness Increment
				0x09, 0x70,                    //   Brightness Decrement
				0x09, 0x6B,                    //   Toggle TouchPad
				0x09, 0xB8,                    //   Usage (Eject)
				0x09, 0xCD,                    //   Usage (Play/Pause)
				0x09, 0xE2,                    //   Usage (Mute)					
				0x09, 0xE9,                    //   Usage (Volume Increment)		
				0x09, 0xEA,                    //   Usage (Volume Decrement)		
				0x81, 0x02,                    //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
				0xC0,                          //   End Collection

1 REPLY 1
MPano.1
Associate

I found the way to toggle flight mode in the wireless control section and here a descriptor to it. Still can't find a way to disable the touchpad.

				0x05, 0x01,                    //   USAGE_PAGE (Generic Desktop)
				0x09, 0x0C,                    //   USAGE (Wireless Radio Controls)
				0xA1, 0x01,                    //   COLLECTION (Application)
				0x85, 0x03,                    //   Report ID (3)
				0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
				0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
				0x09, 0xC6,                    //   USAGE (Wireless Radio Button)
				0x95, 0x01,                    //   REPORT_COUNT (1
				0x75, 0x01,                    //   REPORT_SIZE (1)
				0x81, 0x06,                    //   INPUT (Data,Var,Rel)
				0x75, 0x07,                    //   REPORT_SIZE (7
				0x81, 0x03,                    //   INPUT (Cnst,Var,Abs)
				0xC0,                          //   END_COLLECTION