>> old iMac usb keyboard c. 2001
>> Apple 'Pro' keyboard, c. 2004
>
> these two work for me using the modifications here:
> http://9fans.net/archive/2014/02/202
> setting the langid is critical for some keyboards.
Looking at the patch in that 9fans.net posting, I am puzzled.
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:228,233 - dev.c:233,245
memset(buf, 0, Ddevlen);
if((nr=usbcmd(d, type, Rgetdesc, Ddev<<8|0, 0, buf, nr)) < 0)
return -1;
+ if(nr == 17){
+ print("%s: langid %.4ux\n", argv0, buf[3]<<8|buf[2]);
+ if((nr = usbcmd(d, type, Rgetdesc, Ddev<<8|0, buf[3]<<8|buf[2],
buf, 18)) < 0)
+ return -1;
+ print("%s: nr = %d; buf[%d] = %.2ux\n", argv0, nr, nr, buf[nr]);
+ }
+
This is in function loaddevdesc which loads a device descriptor, not a
string descriptor. The device descriptor doesn't have a language id
in offset 2:3, it has bcdUSB and bDeviceClass in those fields. And
the specification for the Rgetdesc command says "the wIndex field
specifies the LanguageID for string descriptors or is reset to zero
for other descriptors".