# uhidd & TypeMatrix doesn't work well



## graudeejs (Jun 12, 2012)

I have a TypeMatrix 2030 keyboard (http://typematrix.com/). On FreeBSD most special keys don't work. So I decided to test uhidd. It correctly detected multimedia keys.

/usr/local/etc/uhidd.conf

```
# TypeMatrix keyboard specific config
0x1e54:0x2030={
  cc_keymap={
    Scan_Next_Track="0x62"
      Scan_Previous_Track="0x60"
      Eject="0x71"
      Mute="0x54"
      Volume_Increment="0x5F"
      Volume_Decrement="0x5A"
      AL_Email_Reader="0x72"
      AL_Calculator="0x74"
      AC_Back="0x6F"
      AC_Forward="0x63"
  }
}
```

However there is a problem. When I start uhidd and press any key, the key will be repeated until I press Esc. Killing uhidd becomes a great challenge.


```
# uhidd -dvvvko /dev/ugen1.2
ugen1.2[0]-> HID interface
ugen1.2[0]-> Report descriptor size = 64
ugen1.2[0]-> Find IN interrupt ep: 0x81 packet_size=0x8
ugen1.2[1]-> HID interface
ugen1.2[1]-> Report descriptor size = 94
ugen1.2[1]-> Find IN interrupt ep: 0x82 packet_size=0x8
HID APPLICATION COLLECTION (Keyboard) size(64)
  HID REPORT: ID 0
    INPUT: 
      POS:0 SIZE:1 COUNT:8 [VARIABLE]
        USAGE Keyboard LeftControl
        USAGE Keyboard LeftShift
        USAGE Keyboard LeftAlt
        USAGE Keyboard Left GUI
        USAGE Keyboard RightControl
        USAGE Keyboard RightShift
        USAGE Keyboard RightAlt
        USAGE Keyboard Right GUI
      POS:8 SIZE:8 COUNT:1 [CONST]
      POS:16 SIZE:8 COUNT:6 [ARRAY]
        USAGE [0 -> 145] (Keyboard)
    OUTPUT: 
      POS:0 SIZE:1 COUNT:3 [VARIABLE]
        USAGE Num Lock
        USAGE Caps Lock
        USAGE Scroll Lock
      POS:3 SIZE:1 COUNT:5 [CONST]
ugen1.2[0]-> kbd device name: vkbdctl18
ugen1.2[0]-> kbd status changed: leds=0x2
hid_set_report (1) 0x01
ugen1.2[0]-> set_report: id(0) 1
HID APPLICATION COLLECTION (System Control) size(29)
  HID REPORT: ID 1
    INPUT: 
      POS:0 SIZE:2 COUNT:1 [ARRAY]
        USAGE [0 -> 0] (Unknown Page)
      POS:2 SIZE:6 COUNT:1 [CONST]
HID APPLICATION COLLECTION (Consumer Control) size(25)
  HID REPORT: ID 2
    INPUT: 
      POS:0 SIZE:16 COUNT:1 [ARRAY]
        USAGE [0 -> 4095] (Consumer)
HID APPLICATION COLLECTION (Unknown Usage) size(40)
  HID REPORT: ID 3
    INPUT: 
      POS:0 SIZE:16 COUNT:1 [ARRAY]
        USAGE [0 -> 4095] (Microsoft)
    OUTPUT: 
      POS:0 SIZE:8 COUNT:1 [ARRAY]
        USAGE [1 -> 255] (Microsoft)
ugen1.2[1]-> kbd device name: vkbdctl19
ugen1.2[0]-> HID interface task started
ugen1.2[1]-> HID interface task started
augen1.2[0]-> received data(8): 00 00 00 00 00 00 00 00 
hid_appcol_recv_data: len(8) 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
ugen1.2[0]-> mod(0x00) key codes: 0x00 0x00 0x00 0x00 0x00 0x00 
aaaaaaaaaaaaaaa^[ugen1.2[0]-> received data(8): 00 00 00 00 00 00 00 00 
hid_appcol_recv_data: len(8) 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
ugen1.2[0]-> mod(0x00) key codes: 0x00 0x00 0x00 0x00 0x00 0x00 
^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[ugen1.2[0]->
received data(8): 00 00 00 00 00 00 00 00 hid_appcol_recv_data: len(8)
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ugen1.2[0]-> mod(0x00) key
codes: 0x00 0x00 0x00 0x00 0x00 0x00
^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[ugen1.2[0]-> received
data(8): 00 00 00 00 00 00 00 00 hid_appcol_recv_data: len(8) 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 ugen1.2[0]-> mod(0x00) key codes: 0x00
0x00 0x00 0x00 0x00 0x00 ^[^[^[^[^[^[^[^[ugen1.2[0]-> received data(8):
00 00 00 00 00 00 00 00 hid_appcol_recv_data: len(8) 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 ugen1.2[0]-> mod(0x00) key codes: 0x00 0x00
0x00 0x00 0x00 0x00 ^[^[^[^[^[^[^[^[^[^[ugen1.2[0]-> received data(8):
00 00 00 00 00 00 00 00 hid_appcol_recv_data: len(8) 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 ugen1.2[0]-> mod(0x00) key codes: 0x00 0x00
0x00 0x00 0x00 0x00 ^[^[^[^[^[^[^[^[^[^[^[^[^[ugen1.2[0]-> received
data(8): 00 00 00 00 00 00 00 00 hid_appcol_recv_data: len(8) 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 ugen1.2[0]-> mod(0x00) key codes: 0x00
0x00 0x00 0x00 0x00 0x00
^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^[^C^[^[^[^[^[^[^[uhidd[12138]:
terminated ^[^[^[^[^[^[^[^[^[^[desktop#
```

Various info:

```
$ uname -a
FreeBSD desktop.pc 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jun 12 22:50:43 EEST 2012
graudeejs@desktop.pc:/usr/obj/usr/src/sys/MINIMALIST  amd64
```

I'm using a custom stripped GENERIC kernel, with few options not in GENERIC (nothing special).


```
$ kldstat
Id Refs Address            Size     Name
 1   35 0xffffffff80200000 9b7078   kernel
 2    1 0xffffffff80bb8000 8910     vesa.ko
 3    1 0xffffffff80bc1000 203d98   zfs.ko
 4    2 0xffffffff80dc5000 5c60     opensolaris.ko
 5    2 0xffffffff80dcb000 1fe60    krpc.ko
 6    1 0xffffffff80dec000 10a32f0  nvidia.ko
 7    3 0xffffffff81e90000 450e0    linux.ko
 8    1 0xffffffff82012000 42a7     linprocfs.ko
10    1 0xffffffff8201e000 4f39     vkbd.ko
11    1 0xffffffff82023000 146c     uvhid.ko
12    1 0xffffffff82017000 6dc2     ukbd.ko
```
Any ideas?


----------



## tyson (Jun 13, 2012)

Well, my keyboard works with only the -o parameter added to uhidd, so in rc.conf:

```
uhidd_flags="-o"
uhidd_enable="YES"
```
You need only multimedia keys, so -k is not needed anyway.


----------



## Ghostbings (Jun 27, 2012)

Need a lot more detail. Which VM software? Are any of the other VMs on the same host running the same version of FreeBSD without problems? Which version of FreeBSD is running on the problem VM? Is it running X?


----------



## graudeejs (Jun 27, 2012)

Ghostbings said:
			
		

> Need a lot more detail. Which VM software? Are any of the other VMs on the same host running the same version of FreeBSD without problems? Which version of FreeBSD is running on the problem VM? Is it running X?



Yes, thank you. I didn't know I had to provide detailed info. (sarcasm)

P.S.
DutchDaemon: you may close this thread.


----------

