Anton Lindqvist <an...@openbsd.org> writes:

> As the Consumer Control usages are well defined by the HID Usage Tables
> 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 key codes
> ($xenocara/dist/xkeyboard-config/keycodes/evdev) but those symbols are
> not picked up in an vanilla X11 configuration on OpenBSD, according to
> setxkbmap(1).

Looks like most of the rest of the plumbing is missing for my buttons.
I do get the pretty-printed names (below). Sadly no xev wiggling with or
without this patch with my devices.

> 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.

With this patch I get this prettier output:

uhidev2 at uhub3 port 2 configuration 1 interface 2 "Kinesis Advantage2 
Keyboard" rev 2.00/1.00 addr 4
uhidev2: iclass 3/0, 2 report ids
ucc0 at uhidev2 reportid 1ucc_add_key: bit 0, usage "Scan Next Track"
ucc_add_key: bit 1, usage "Scan Previous Track"
ucc_add_key: bit 2, usage "Play/Pause"
ucc_add_key: bit 3, usage "Mute"
ucc_add_key: bit 4, usage "Volume Increment"
ucc_add_key: bit 5, usage "Volume Decrement"
ucc_add_key: bit 6, usage "AL Calculator"
: 7 usages, 7 keys, enum
wskbd2 at ucc0 mux 1
uhid0 at uhidev2 reportid 2: input=1, output=0, feature=0

uaudio0 at uhub0 port 5 configuration 1 interface 1 "Google Pixel USB-C 
earbuds" rev 2.00/0.20 addr 7
uaudio0: class v1, full-speed, sync, channels: 2 play, 1 rec, 7 ctls
audio1 at uaudio0
uhidev5 at uhub0 port 5 configuration 1 interface 3 "Google Pixel USB-C 
earbuds" rev 2.00/0.20 addr 7
uhidev5: iclass 3/0, 5 report ids
uhid1 at uhidev5 reportid 1: input=1, output=0, feature=0
uhid2 at uhidev5 reportid 4: input=0, output=38, feature=0
ucc1 at uhidev5 reportid 5ucc_add_key: bit 0, usage "Volume Increment"
ucc_add_key: bit 1, usage "Volume Decrement"
ucc_add_key: bit 2, usage "Play/Pause"
: 37 usages, 3 keys, enum
wskbd3 at ucc1 mux 1

The earbuds buttons are working when connected to a phone, so they
aren't damaged.

Thanks
Greg

Reply via email to