As the Consumer Control usages are well defined by the HID Usage Tables
authoranton <anton@openbsd.org>
Sun, 29 Aug 2021 18:17:51 +0000 (18:17 +0000)
committeranton <anton@openbsd.org>
Sun, 29 Aug 2021 18:17:51 +0000 (18:17 +0000)
specification ucc might as well enumerate all of them. Finding an
appropriate scan code recognized by X11 for each usage is more tricky.
I've added a few more but the majority are still unmapped. Linux has
defined a couple of more usages covered by the evdev[1] key codes but
those symbols are not picked up in an vanilla X11 configuration on
OpenBSD, according to setxkbmap(1).

This should at least lower the barrier for adding scan codes for wanted
keys.

Note that the strings are discarded unless UCC_DEBUG is enabled.

Thanks to gnezdo@ for testing.

[1] xenocara/dist/xkeyboard-config/keycodes/evdev

sys/dev/usb/ucc.c

index 59c629d..c60e0d2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ucc.c,v 1.13 2021/08/26 10:32:35 anton Exp $  */
+/*     $OpenBSD: ucc.c,v 1.14 2021/08/29 18:17:51 anton Exp $  */
 
 /*
  * Copyright (c) 2021 Anton Lindqvist <anton@openbsd.org>
@@ -69,7 +69,9 @@ struct ucc_softc {
 };
 
 struct ucc_keysym {
+#ifdef UCC_DEBUG
        const char      *us_name;
+#endif
        int32_t          us_usage;
        keysym_t         us_key;
        u_char           us_raw;
@@ -108,26 +110,493 @@ const struct cfattach ucc_ca = {
 };
 
 /*
- * Mapping of HID consumer control usages to key symbols.
- * The raw scan codes are taken from X11, see the media_common symbols in
- * dist/xkeyboard-config/symbols/inet.
+ * Mapping of HID Consumer Control usages to key symbols based on the HID Usage
+ * Tables 1.21 specification. The same usages can also be found at
+ * /usr/share/misc/usb_hid_usages.
+ * The raw scan codes are taken from X11, see the media_nav_acpi_common symbols
+ * in dist/xkeyboard-config/symbols/inet.
  * Then use dist/xkeyboard-config/keycodes/xfree86 to resolve keys to the
  * corresponding raw scan code.
  */
 static const struct ucc_keysym ucc_keysyms[] = {
 #ifdef UCC_DEBUG
-#define U(x)   #x, x
+#define Y(usage, name, key, raw)       { name, usage, key, raw },
 #else
-#define U(x)   NULL, x
+#define Y(usage, name, key, raw)       { usage, key, raw },
 #endif
-       { U(HUC_MUTE),          KS_AudioMute,   0 },
-       { U(HUC_VOL_INC),       KS_AudioRaise,  0 },
-       { U(HUC_VOL_DEC),       KS_AudioLower,  0 },
-       { U(HUC_TRACK_NEXT),    0,              153 /* I19 = XF86AudioNext */ },
-       { U(HUC_TRACK_PREV),    0,              144 /* I10 = XF86AudioPrev */ },
-       { U(HUC_STOP),          0,              164 /* I24 = XF86AudioStop */ },
-       { U(HUC_PLAY_PAUSE),    0,              162 /* I22 = XF86AudioPlay, XF86AudioPause */ },
-#undef U
+#define N(usage, name, key, raw)
+       /* 0x0000 Unassigned */
+       N(0x0001,       "Consumer Control",                             0,              0)
+       N(0x0002,       "Numeric Key Pad",                              0,              0)
+       N(0x0003,       "Programmable Buttons",                         0,              0)
+       N(0x0004,       "Microphone",                                   0,              0)
+       N(0x0005,       "Headphone",                                    0,              0)
+       N(0x0006,       "Graphic Equalizer",                            0,              0)
+       /* 0x0007-0x001F Reserved */
+       N(0x0020,       "+10",                                          0,              0)
+       N(0x0021,       "+100",                                         0,              0)
+       N(0x0022,       "AM/PM",                                        0,              0)
+       /* 0x0023-0x002F Reserved */
+       Y(0x0030,       "Power",                                        0,              222 /* I5E = XF86PowerOff */)
+       N(0x0031,       "Reset",                                        0,              0)
+       Y(0x0032,       "Sleep",                                        0,              150 /* I16 = XF86Sleep */)
+       N(0x0033,       "Sleep After",                                  0,              0)
+       N(0x0034,       "Sleep Mode",                                   0,              0)
+       N(0x0035,       "Illumination",                                 0,              0)
+       N(0x0036,       "Function Buttons",                             0,              0)
+       /* 0x0037-0x003F Reserved */
+       N(0x0040,       "Menu",                                         0,              0)
+       N(0x0041,       "Menu Pick",                                    0,              0)
+       N(0x0042,       "Menu Up",                                      0,              0)
+       N(0x0043,       "Menu Down",                                    0,              0)
+       N(0x0044,       "Menu Left",                                    0,              0)
+       N(0x0045,       "Menu Right",                                   0,              0)
+       N(0x0046,       "Menu Escape",                                  0,              0)
+       N(0x0047,       "Menu Value Increase",                          0,              0)
+       N(0x0048,       "Menu Value Decrease",                          0,              0)
+       /* 0x0049-0x005F Reserved */
+       N(0x0060,       "Data On Screen",                               0,              0)
+       N(0x0061,       "Closed Caption",                               0,              0)
+       N(0x0062,       "Closed Caption Select",                        0,              0)
+       N(0x0063,       "VCR/TV",                                       0,              0)
+       N(0x0064,       "Broadcast Mode",                               0,              0)
+       N(0x0065,       "Snapshot",                                     0,              0)
+       N(0x0066,       "Still",                                        0,              0)
+       N(0x0067,       "Picture-in-Picture Toggle",                    0,              0)
+       N(0x0068,       "Picture-in-Picture Swap",                      0,              0)
+       N(0x0069,       "Red Menu Button",                              0,              0)
+       N(0x006A,       "Green Menu Button",                            0,              0)
+       N(0x006B,       "Blue Menu Button",                             0,              0)
+       N(0x006C,       "Yellow Menu Button",                           0,              0)
+       N(0x006D,       "Aspect",                                       0,              0)
+       N(0x006E,       "3D Mode Select",                               0,              0)
+       N(0x006F,       "Display Brightness Increment",                 0,              0)
+       N(0x0070,       "Display Brightness Decrement",                 0,              0)
+       N(0x0071,       "Display Brightness",                           0,              0)
+       N(0x0072,       "Display Backlight Toggle",                     0,              0)
+       N(0x0073,       "Display Set Brightness to Minimum",            0,              0)
+       N(0x0074,       "Display Set Brightness to Maximum",            0,              0)
+       N(0x0075,       "Display Set Auto Brightness",                  0,              0)
+       N(0x0076,       "Camera Access Enabled",                        0,              0)
+       N(0x0077,       "Camera Access Disabled",                       0,              0)
+       N(0x0078,       "Camera Access Toggle",                         0,              0)
+       N(0x0079,       "Keyboard Brightness Increment",                0,              0)
+       N(0x007A,       "Keyboard Brightness Decrement",                0,              0)
+       N(0x007B,       "Keyboard Backlight Set Level",                 0,              0)
+       N(0x007C,       "Keyboard Backlight OOC",                       0,              0)
+       N(0x007D,       "Keyboard Backlight Set Minimum",               0,              0)
+       N(0x007E,       "Keyboard Backlight Set Maximum",               0,              0)
+       N(0x007F,       "Keyboard Backlight Auto",                      0,              0)
+       N(0x0080,       "Selection",                                    0,              0)
+       N(0x0081,       "Assign Selection",                             0,              0)
+       N(0x0082,       "Mode Step",                                    0,              0)
+       N(0x0083,       "Recall Last",                                  0,              0)
+       N(0x0084,       "Enter Channel",                                0,              0)
+       N(0x0085,       "Order Movie",                                  0,              0)
+       N(0x0086,       "Channel",                                      0,              0)
+       N(0x0087,       "Media Selection",                              0,              0)
+       N(0x0088,       "Media Select Computer",                        0,              0)
+       N(0x0089,       "Media Select TV",                              0,              0)
+       N(0x008A,       "Media Select WWW",                             0,              0)
+       N(0x008B,       "Media Select DVD",                             0,              0)
+       N(0x008C,       "Media Select Telephone",                       0,              0)
+       N(0x008D,       "Media Select Program Guide",                   0,              0)
+       N(0x008E,       "Media Select Video Phone",                     0,              0)
+       N(0x008F,       "Media Select Games",                           0,              0)
+       N(0x0090,       "Media Select Messages",                        0,              0)
+       N(0x0091,       "Media Select CD",                              0,              0)
+       N(0x0092,       "Media Select VCR",                             0,              0)
+       N(0x0093,       "Media Select Tuner",                           0,              0)
+       N(0x0094,       "Quit",                                         0,              0)
+       N(0x0095,       "Help",                                         0,              0)
+       N(0x0096,       "Media Select Tape",                            0,              0)
+       N(0x0097,       "Media Select Cable",                           0,              0)
+       N(0x0098,       "Media Select Satellite",                       0,              0)
+       N(0x0099,       "Media Select Security",                        0,              0)
+       N(0x009A,       "Media Select Home",                            0,              0)
+       N(0x009B,       "Media Select Call",                            0,              0)
+       N(0x009C,       "Channel Increment",                            0,              0)
+       N(0x009D,       "Channel Decrement",                            0,              0)
+       N(0x009E,       "Media Select SAP",                             0,              0)
+       /* 0x009F-0x009F Reserved */
+       N(0x00A0,       "VCR Plus",                                     0,              0)
+       N(0x00A1,       "Once",                                         0,              0)
+       N(0x00A2,       "Daily",                                        0,              0)
+       N(0x00A3,       "Weekly",                                       0,              0)
+       N(0x00A4,       "Monthly",                                      0,              0)
+       /* 0x00A5-0x00AF Reserved */
+       N(0x00B0,       "Play",                                         0,              0)
+       N(0x00B1,       "Pause",                                        0,              0)
+       N(0x00B2,       "Record",                                       0,              0)
+       N(0x00B3,       "Fast Forward",                                 0,              0)
+       N(0x00B4,       "Rewind",                                       0,              0)
+       Y(0x00B5,       "Scan Next Track",                              0,              153 /* I19 = XF86AudioNext */)
+       Y(0x00B6,       "Scan Previous Track",                          0,              144 /* I10 = XF86AudioPrev */)
+       Y(0x00B7,       "Stop",                                         0,              164 /* I24 = XF86AudioStop */)
+       Y(0x00B8,       "Eject",                                        0,              170 /* K5A = XF86Eject */)
+       N(0x00B9,       "Random Play",                                  0,              0)
+       N(0x00BA,       "Select Disc",                                  0,              0)
+       N(0x00BB,       "Enter Disc",                                   0,              0)
+       N(0x00BC,       "Repeat",                                       0,              0)
+       N(0x00BD,       "Tracking",                                     0,              0)
+       N(0x00BE,       "Track Normal",                                 0,              0)
+       N(0x00BF,       "Slow Tracking",                                0,              0)
+       N(0x00C0,       "Frame Forward",                                0,              0)
+       N(0x00C1,       "Frame Back",                                   0,              0)
+       N(0x00C2,       "Mark",                                         0,              0)
+       N(0x00C3,       "Clear Mark",                                   0,              0)
+       N(0x00C4,       "Repeat From Mark",                             0,              0)
+       N(0x00C5,       "Return To Mark",                               0,              0)
+       N(0x00C6,       "Search Mark Forward",                          0,              0)
+       N(0x00C7,       "Search Mark Backwards",                        0,              0)
+       N(0x00C8,       "Counter Reset",                                0,              0)
+       N(0x00C9,       "Show Counter",                                 0,              0)
+       N(0x00CA,       "Tracking Increment",                           0,              0)
+       N(0x00CB,       "Tracking Decrement",                           0,              0)
+       N(0x00CC,       "Stop/Eject",                                   0,              0)
+       Y(0x00CD,       "Play/Pause",                                   0,              162 /* I22 = XF86AudioPlay */)
+       N(0x00CE,       "Play/Skip",                                    0,              0)
+       N(0x00CF,       "Voice Command",                                0,              0)
+       N(0x00D0,       "Invoke Capture Interface",                     0,              0)
+       N(0x00D1,       "Start or Stop Game Recording",                 0,              0)
+       N(0x00D2,       "Historical Game Capture",                      0,              0)
+       N(0x00D3,       "Capture Game Screenshot",                      0,              0)
+       N(0x00D4,       "Show or Hide Recording Indicator",             0,              0)
+       N(0x00D5,       "Start or Stop Microphone Capture",             0,              0)
+       N(0x00D6,       "Start or Stop Camera Capture",                 0,              0)
+       N(0x00D7,       "Start or Stop Game Broadcast",                 0,              0)
+       /* 0x00D8-0x00DF Reserved */
+       N(0x00E0,       "Volume",                                       0,              0)
+       N(0x00E1,       "Balance",                                      0,              0)
+       Y(0x00E2,       "Mute",                                         KS_AudioMute,   0)
+       N(0x00E3,       "Bass",                                         0,              0)
+       N(0x00E4,       "Treble",                                       0,              0)
+       N(0x00E5,       "Bass Boost",                                   0,              0)
+       N(0x00E6,       "Surround Mode",                                0,              0)
+       N(0x00E7,       "Loudness",                                     0,              0)
+       N(0x00E8,       "MPX",                                          0,              0)
+       Y(0x00E9,       "Volume Increment",                             KS_AudioRaise,  0)
+       Y(0x00EA,       "Volume Decrement",                             KS_AudioLower,  0)
+       /* 0x00EB-0x00EF Reserved */
+       N(0x00F0,       "Speed Select",                                 0,              0)
+       N(0x00F1,       "Playback Speed",                               0,              0)
+       N(0x00F2,       "Standard Play",                                0,              0)
+       N(0x00F3,       "Long Play",                                    0,              0)
+       N(0x00F4,       "Extended Play",                                0,              0)
+       N(0x00F5,       "Slow",                                         0,              0)
+       /* 0x00F6-0x00FF Reserved */
+       N(0x0100,       "Fan Enable",                                   0,              0)
+       N(0x0101,       "Fan Speed",                                    0,              0)
+       N(0x0102,       "Light Enable",                                 0,              0)
+       N(0x0103,       "Light Illumination Level",                     0,              0)
+       N(0x0104,       "Climate Control Enable",                       0,              0)
+       N(0x0105,       "Room Temperature",                             0,              0)
+       N(0x0106,       "Security Enable",                              0,              0)
+       N(0x0107,       "Fire Alarm",                                   0,              0)
+       N(0x0108,       "Police Alarm",                                 0,              0)
+       N(0x0109,       "Proximity",                                    0,              0)
+       N(0x010A,       "Motion",                                       0,              0)
+       N(0x010B,       "Duress Alarm",                                 0,              0)
+       N(0x010C,       "Holdup Alarm",                                 0,              0)
+       N(0x010D,       "Medical Alarm",                                0,              0)
+       /* 0x010E-0x014F Reserved */
+       N(0x0150,       "Balance Right",                                0,              0)
+       N(0x0151,       "Balance Left",                                 0,              0)
+       N(0x0152,       "Bass Increment",                               0,              0)
+       N(0x0153,       "Bass Decrement",                               0,              0)
+       N(0x0154,       "Treble Increment",                             0,              0)
+       N(0x0155,       "Treble Decrement",                             0,              0)
+       /* 0x0156-0x015F Reserved */
+       N(0x0160,       "Speaker System",                               0,              0)
+       N(0x0161,       "Channel Left",                                 0,              0)
+       N(0x0162,       "Channel Right",                                0,              0)
+       N(0x0163,       "Channel Center",                               0,              0)
+       N(0x0164,       "Channel Front",                                0,              0)
+       N(0x0165,       "Channel Center Front",                         0,              0)
+       N(0x0166,       "Channel Side",                                 0,              0)
+       N(0x0167,       "Channel Surround",                             0,              0)
+       N(0x0168,       "Channel Low Frequency Enhancement",            0,              0)
+       N(0x0169,       "Channel Top",                                  0,              0)
+       N(0x016A,       "Channel Unknown",                              0,              0)
+       /* 0x016B-0x016F Reserved */
+       N(0x0170,       "Sub-channel",                                  0,              0)
+       N(0x0171,       "Sub-channel Increment",                        0,              0)
+       N(0x0172,       "Sub-channel Decrement",                        0,              0)
+       N(0x0173,       "Alternate Audio Increment",                    0,              0)
+       N(0x0174,       "Alternate Audio Decrement",                    0,              0)
+       /* 0x0175-0x017F Reserved */
+       N(0x0180,       "Application Launch Buttons",                   0,              0)
+       N(0x0181,       "AL Launch Button Configuration Tool",          0,              0)
+       N(0x0182,       "AL Programmable Button Configuration",         0,              0)
+       N(0x0183,       "AL Consumer Control Configuration",            0,              0)
+       N(0x0184,       "AL Word Processor",                            0,              0)
+       N(0x0185,       "AL Text Editor",                               0,              0)
+       N(0x0186,       "AL Spreadsheet",                               0,              0)
+       N(0x0187,       "AL Graphics Editor",                           0,              0)
+       N(0x0188,       "AL Presentation App",                          0,              0)
+       N(0x0189,       "AL Database App",                              0,              0)
+       Y(0x018A,       "AL Email Reader",                              0,              235 /* I6C = XF86Mail */)
+       N(0x018B,       "AL Newsreader",                                0,              0)
+       N(0x018C,       "AL Voicemail",                                 0,              0)
+       N(0x018D,       "AL Contacts/Address Book",                     0,              0)
+       N(0x018E,       "AL Calendar/Schedule",                         0,              0)
+       N(0x018F,       "AL Task/Project Manager",                      0,              0)
+       N(0x0190,       "AL Log/Journal/Timecard",                      0,              0)
+       N(0x0191,       "AL Checkbook/Finance",                         0,              0)
+       Y(0x0192,       "AL Calculator",                                0,              161 /* I21 = XF86Calculator */)
+       N(0x0193,       "AL A/V Capture/Playback",                      0,              0)
+       N(0x0194,       "AL Local Machine Browser",                     0,              0)
+       N(0x0195,       "AL LAN/WAN Browser",                           0,              0)
+       Y(0x0196,       "AL Internet Browser",                          0,              178 /* I32 = XF86WWW */)
+       N(0x0197,       "AL Remote Networking/ISP Connect",             0,              0)
+       N(0x0198,       "AL Network Conference",                        0,              0)
+       N(0x0199,       "AL Network Chat",                              0,              0)
+       N(0x019A,       "AL Telephony/Dialer",                          0,              0)
+       N(0x019B,       "AL Logon",                                     0,              0)
+       N(0x019C,       "AL Logoff",                                    0,              0)
+       N(0x019D,       "AL Logon/Logoff",                              0,              0)
+       N(0x019E,       "AL Terminal Lock/Screensaver",                 0,              0)
+       N(0x019F,       "AL Control Panel",                             0,              0)
+       N(0x01A0,       "AL Command Line Processor/Run",                0,              0)
+       N(0x01A1,       "AL Process/Task Manager",                      0,              0)
+       N(0x01A2,       "AL Select Tast/Application",                   0,              0)
+       N(0x01A3,       "AL Next Task/Application",                     0,              0)
+       N(0x01A4,       "AL Previous Task/Application",                 0,              0)
+       N(0x01A5,       "AL Preemptive Halt Task/Application",          0,              0)
+       N(0x01A6,       "AL Integrated Help Center",                    0,              0)
+       N(0x01A7,       "AL My Documents",                              0,              0)
+       N(0x01A8,       "AL Thesaurus",                                 0,              0)
+       N(0x01A9,       "AL Dictionary",                                0,              0)
+       N(0x01AA,       "AL Desktop",                                   0,              0)
+       N(0x01AB,       "AC Spell",                                     0,              0)
+       N(0x01AC,       "AL Grammar Check",                             0,              0)
+       N(0x01AD,       "AL Wireless Status",                           0,              0)
+       N(0x01AE,       "AL Keyboard Layout",                           0,              0)
+       N(0x01AF,       "AL Virus Protection",                          0,              0)
+       N(0x01B0,       "AL Encryption",                                0,              0)
+       N(0x01B1,       "AL Screen Saver",                              0,              0)
+       N(0x01B2,       "AL Alarms",                                    0,              0)
+       N(0x01B3,       "AL Clock",                                     0,              0)
+       N(0x01B4,       "AL File Browser",                              0,              0)
+       N(0x01B5,       "AL Power Status",                              0,              0)
+       N(0x01B6,       "AL My Pictures",                               0,              0)
+       N(0x01B7,       "AL My Music",                                  0,              0)
+       N(0x01B8,       "AL Movie Browser",                             0,              0)
+       N(0x01B9,       "AL Digital Rights Manager",                    0,              0)
+       N(0x01BA,       "AL Digital Wallet",                            0,              0)
+       /* 0x01BB-0x01BB Reserved */
+       N(0x01BC,       "AL Instant Messaging",                         0,              0)
+       N(0x01BD,       "AL OEM Feature/Tips/Tutorial Browser",         0,              0)
+       N(0x01BE,       "AL OEM Help",                                  0,              0)
+       N(0x01BF,       "AL Online Community",                          0,              0)
+       N(0x01C0,       "AL Entertainment Content Browser",             0,              0)
+       N(0x01C1,       "AL Online Shopping Browser",                   0,              0)
+       N(0x01C2,       "AL SmartCard Information/Help",                0,              0)
+       N(0x01C3,       "AL Market Monitor/Finance Browser",            0,              0)
+       N(0x01C4,       "AL Customized Corporate News Browser",         0,              0)
+       N(0x01C5,       "AL Online Activity Browser",                   0,              0)
+       Y(0x01C6,       "AL Research/Search Browser",                   0,              229 /* I65 = XF86Search */)
+       N(0x01C7,       "AL Audio Player",                              0,              0)
+       N(0x01C8,       "AL Message Status",                            0,              0)
+       N(0x01C9,       "AL Contact Sync",                              0,              0)
+       N(0x01CA,       "AL Navigation",                                0,              0)
+       N(0x01CB,       "AL Context-aware Desktop Assistant",           0,              0)
+       /* 0x01CC-0x01FF Reserved */
+       N(0x0200,       "Generic GUI Application Controls",             0,              0)
+       N(0x0201,       "AC New",                                       0,              0)
+       N(0x0202,       "AC Open",                                      0,              0)
+       N(0x0203,       "AC Close",                                     0,              0)
+       N(0x0204,       "AC Exit",                                      0,              0)
+       N(0x0205,       "AC Maximize",                                  0,              0)
+       N(0x0206,       "AC Minimize",                                  0,              0)
+       N(0x0207,       "AC Save",                                      0,              0)
+       N(0x0208,       "AC Print",                                     0,              0)
+       N(0x0209,       "AC Properties",                                0,              0)
+       /* 0x020A-0x0219 Reserved */
+       N(0x021A,       "AC Undo",                                      0,              0)
+       N(0x021B,       "AC Copy",                                      0,              0)
+       N(0x021C,       "AC Cut",                                       0,              0)
+       N(0x021D,       "AC Paste",                                     0,              0)
+       N(0x021E,       "AC Select All",                                0,              0)
+       N(0x021F,       "AC Find",                                      0,              0)
+       N(0x0220,       "AC Find and Replace",                          0,              0)
+       N(0x0221,       "AC Search",                                    0,              0)
+       N(0x0222,       "AC Go To",                                     0,              0)
+       N(0x0223,       "AC Home",                                      0,              0)
+       Y(0x0224,       "AC Back",                                      0,              234 /* I6A = XF86Back */)
+       Y(0x0225,       "AC Forward",                                   0,              233 /* I69 = XF86Forward */)
+       Y(0x0226,       "AC Stop",                                      0,              232 /* I68 = XF86Stop */)
+       Y(0x0227,       "AC Refresh",                                   0,              231 /* I67 = XF86Reload */)
+       N(0x0228,       "AC Previous Link",                             0,              0)
+       N(0x0229,       "AC Next Link",                                 0,              0)
+       N(0x022A,       "AC Bookmarks",                                 0,              0)
+       N(0x022B,       "AC History",                                   0,              0)
+       N(0x022C,       "AC Subscriptions",                             0,              0)
+       N(0x022D,       "AC Zoom In",                                   0,              0)
+       N(0x022E,       "AC Zoom Out",                                  0,              0)
+       N(0x022F,       "AC Zoom",                                      0,              0)
+       N(0x0230,       "AC Full Screen View",                          0,              0)
+       N(0x0231,       "AC Normal View",                               0,              0)
+       N(0x0232,       "AC View Toggle",                               0,              0)
+       N(0x0233,       "AC Scroll Up",                                 0,              0)
+       N(0x0234,       "AC Scroll Down",                               0,              0)
+       N(0x0235,       "AC Scroll",                                    0,              0)
+       N(0x0236,       "AC Pan Left",                                  0,              0)
+       N(0x0237,       "AC Pan Right",                                 0,              0)
+       N(0x0238,       "AC Pan",                                       0,              0)
+       N(0x0239,       "AC New Window",                                0,              0)
+       N(0x023A,       "AC Tile Horizontally",                         0,              0)
+       N(0x023B,       "AC Tile Vertically",                           0,              0)
+       N(0x023C,       "AC Format",                                    0,              0)
+       N(0x023D,       "AC Edit",                                      0,              0)
+       N(0x023E,       "AC Bold",                                      0,              0)
+       N(0x023F,       "AC Italics",                                   0,              0)
+       N(0x0240,       "AC Underline",                                 0,              0)
+       N(0x0241,       "AC Strikethrough",                             0,              0)
+       N(0x0242,       "AC Subscript",                                 0,              0)
+       N(0x0243,       "AC Superscript",                               0,              0)
+       N(0x0244,       "AC All Caps",                                  0,              0)
+       N(0x0245,       "AC Rotate",                                    0,              0)
+       N(0x0246,       "AC Resize",                                    0,              0)
+       N(0x0247,       "AC Flip Horizontal",                           0,              0)
+       N(0x0248,       "AC Flip Vertical",                             0,              0)
+       N(0x0249,       "AC Mirror Horizontal",                         0,              0)
+       N(0x024A,       "AC Mirror Vertical",                           0,              0)
+       N(0x024B,       "AC Font Select",                               0,              0)
+       N(0x024C,       "AC Font Color",                                0,              0)
+       N(0x024D,       "AC Font Size",                                 0,              0)
+       N(0x024E,       "AC Justify Left",                              0,              0)
+       N(0x024F,       "AC Justify Center H",                          0,              0)
+       N(0x0250,       "AC Justify Right",                             0,              0)
+       N(0x0251,       "AC Justify Block H",                           0,              0)
+       N(0x0252,       "AC Justify Top",                               0,              0)
+       N(0x0253,       "AC Justify Center V",                          0,              0)
+       N(0x0254,       "AC Justify Bottom",                            0,              0)
+       N(0x0255,       "AC Justify Block V",                           0,              0)
+       N(0x0256,       "AC Justify Decrease",                          0,              0)
+       N(0x0257,       "AC Justify Increase",                          0,              0)
+       N(0x0258,       "AC Numbered List",                             0,              0)
+       N(0x0259,       "AC Restart Numbering",                         0,              0)
+       N(0x025A,       "AC Bulleted List",                             0,              0)
+       N(0x025B,       "AC Promote",                                   0,              0)
+       N(0x025C,       "AC Demote",                                    0,              0)
+       N(0x025D,       "AC Yes",                                       0,              0)
+       N(0x025E,       "AC No",                                        0,              0)
+       N(0x025F,       "AC Cancel",                                    0,              0)
+       N(0x0260,       "AC Catalog",                                   0,              0)
+       N(0x0261,       "AC Buy/Checkout",                              0,              0)
+       N(0x0262,       "AC Add to Cart",                               0,              0)
+       N(0x0263,       "AC Expand",                                    0,              0)
+       N(0x0264,       "AC Expand All",                                0,              0)
+       N(0x0265,       "AC Collapse",                                  0,              0)
+       N(0x0266,       "AC Collapse All",                              0,              0)
+       N(0x0267,       "AC Print Preview",                             0,              0)
+       N(0x0268,       "AC Paste Special",                             0,              0)
+       N(0x0269,       "AC Insert Mode",                               0,              0)
+       N(0x026A,       "AC Delete",                                    0,              0)
+       N(0x026B,       "AC Lock",                                      0,              0)
+       N(0x026C,       "AC Unlock",                                    0,              0)
+       N(0x026D,       "AC Protect",                                   0,              0)
+       N(0x026E,       "AC Unprotect",                                 0,              0)
+       N(0x026F,       "AC Attach Comment",                            0,              0)
+       N(0x0270,       "AC Delete Comment",                            0,              0)
+       N(0x0271,       "AC View Comment",                              0,              0)
+       N(0x0272,       "AC Select Word",                               0,              0)
+       N(0x0273,       "AC Select Sentence",                           0,              0)
+       N(0x0274,       "AC Select Paragraph",                          0,              0)
+       N(0x0275,       "AC Select Column",                             0,              0)
+       N(0x0276,       "AC Select Row",                                0,              0)
+       N(0x0277,       "AC Select Table",                              0,              0)
+       N(0x0278,       "AC Select Object",                             0,              0)
+       N(0x0279,       "AC Redo/Repeat",                               0,              0)
+       N(0x027A,       "AC Sort",                                      0,              0)
+       N(0x027B,       "AC Sort Ascending",                            0,              0)
+       N(0x027C,       "AC Sort Descending",                           0,              0)
+       N(0x027D,       "AC Filter",                                    0,              0)
+       N(0x027E,       "AC Set Clock",                                 0,              0)
+       N(0x027F,       "AC View Clock",                                0,              0)
+       N(0x0280,       "AC Select Time Zone",                          0,              0)
+       N(0x0281,       "AC Edit Time Zones",                           0,              0)
+       N(0x0282,       "AC Set Alarm",                                 0,              0)
+       N(0x0283,       "AC Clear Alarm",                               0,              0)
+       N(0x0284,       "AC Snooze Alarm",                              0,              0)
+       N(0x0285,       "AC Reset Alarm",                               0,              0)
+       N(0x0286,       "AC Synchronize",                               0,              0)
+       N(0x0287,       "AC Send/Receive",                              0,              0)
+       N(0x0288,       "AC Send To",                                   0,              0)
+       N(0x0289,       "AC Reply",                                     0,              0)
+       N(0x028A,       "AC Reply All",                                 0,              0)
+       N(0x028B,       "AC Forward Message",                           0,              0)
+       N(0x028C,       "AC Send",                                      0,              0)
+       N(0x028D,       "AC Attach File",                               0,              0)
+       N(0x028E,       "AC Upload",                                    0,              0)
+       N(0x028F,       "AC Download (Save Target As)",                 0,              0)
+       N(0x0290,       "AC Set Borders",                               0,              0)
+       N(0x0291,       "AC Insert Row",                                0,              0)
+       N(0x0292,       "AC Insert Column",                             0,              0)
+       N(0x0293,       "AC Insert File",                               0,              0)
+       N(0x0294,       "AC Insert Picture",                            0,              0)
+       N(0x0295,       "AC Insert Object",                             0,              0)
+       N(0x0296,       "AC Insert Symbol",                             0,              0)
+       N(0x0297,       "AC Save and Close",                            0,              0)
+       N(0x0298,       "AC Rename",                                    0,              0)
+       N(0x0299,       "AC Merge",                                     0,              0)
+       N(0x029A,       "AC Split",                                     0,              0)
+       N(0x029B,       "AC Distribute Horizontally",                   0,              0)
+       N(0x029C,       "AC Distribute Vertically",                     0,              0)
+       N(0x029D,       "AC Next Keyboard Layout Select",               0,              0)
+       N(0x029E,       "AC Navigation Guidance",                       0,              0)
+       N(0x029F,       "AC Desktop Show All Windows",                  0,              0)
+       N(0x02A0,       "AC Soft Key Left",                             0,              0)
+       N(0x02A1,       "AC Soft Key Right",                            0,              0)
+       N(0x02A2,       "AC Desktop Show All Applications",             0,              0)
+       /* 0x02A3-0x02AF Reserved */
+       N(0x02B0,       "AC Idle Keep Alive",                           0,              0)
+       /* 0x02B1-0x02BF Reserved */
+       N(0x02C0,       "Extended Keyboard Attributes Collection",      0,              0)
+       N(0x02C1,       "Keyboard Form Factor",                         0,              0)
+       N(0x02C2,       "Keyboard Key Type",                            0,              0)
+       N(0x02C3,       "Keyboard Physical Layout",                     0,              0)
+       N(0x02C4,       "Vendor-Specific Keyboard Physical Layout",     0,              0)
+       N(0x02C5,       "Keyboard IETF Language Tag Index",             0,              0)
+       N(0x02C6,       "Implemented Keyboard Input Assist Controls",   0,              0)
+       N(0x02C7,       "Keyboard Input Assist Previous",               0,              0)
+       N(0x02C8,       "Keyboard Input Assist Next",                   0,              0)
+       N(0x02C9,       "Keyboard Input Assist Previous Group",         0,              0)
+       N(0x02CA,       "Keyboard Input Assist Next Group",             0,              0)
+       N(0x02CB,       "Keyboard Input Assist Accept",                 0,              0)
+       N(0x02CC,       "Keyboard Input Assist Cancel",                 0,              0)
+       /* 0x02CD-0x02CF Reserved */
+       N(0x02D0,       "Privacy Screen Toggle",                        0,              0)
+       N(0x02D1,       "Privacy Screen Level Decrement",               0,              0)
+       N(0x02D2,       "Privacy Screen Level Increment",               0,              0)
+       N(0x02D3,       "Privacy Screen Level Minimum",                 0,              0)
+       N(0x02D4,       "Privacy Screen Level Maximum",                 0,              0)
+       /* 0x02D5-0x04FF Reserved */
+       N(0x0500,       "Contact Edited",                               0,              0)
+       N(0x0501,       "Contact Added",                                0,              0)
+       N(0x0502,       "Contact Record Active",                        0,              0)
+       N(0x0503,       "Contact Index",                                0,              0)
+       N(0x0504,       "Contact Nickname",                             0,              0)
+       N(0x0505,       "Contact First Name",                           0,              0)
+       N(0x0506,       "Contact Last Name",                            0,              0)
+       N(0x0507,       "Contact Full Name",                            0,              0)
+       N(0x0508,       "Contact Phone Number Personal",                0,              0)
+       N(0x0509,       "Contact Phone Number Business",                0,              0)
+       N(0x050A,       "Contact Phone Number Mobile",                  0,              0)
+       N(0x050B,       "Contact Phone Number Pager",                   0,              0)
+       N(0x050C,       "Contact Phone Number Fax",                     0,              0)
+       N(0x050D,       "Contact Phone Number Other",                   0,              0)
+       N(0x050E,       "Contact Email Personal",                       0,              0)
+       N(0x050F,       "Contact Email Business",                       0,              0)
+       N(0x0510,       "Contact Email Other",                          0,              0)
+       N(0x0511,       "Contact Email Main",                           0,              0)
+       N(0x0512,       "Contact Speed Dial Number",                    0,              0)
+       N(0x0513,       "Contact Status Flag",                          0,              0)
+       N(0x0514,       "Contact Misc.",                                0,              0)
+       /* 0x0515-0x0FFF Reserved */
+#undef Y
+#undef N
 };
 
 int
@@ -449,7 +918,7 @@ ucc_add_key(struct ucc_softc *sc, int32_t usage, u_int bit)
                sc->sc_raw[bit] = us;
        }
 
-       DPRINTF("%s: bit %d, usage %s\n", __func__,
+       DPRINTF("%s: bit %d, usage \"%s\"\n", __func__,
            bit, us->us_name);
        return 0;
 }