Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| uhidd [2010/03/07 00:48] – KaiWang | uhidd [2019/09/18 02:39] (current) – Replace external image URL with local attachment KubilayKocak | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| '' | '' | ||
| to be created to make it function. See the examples section below. | to be created to make it function. See the examples section below. | ||
| + | |||
| + | ====== News ====== | ||
| + | |||
| + | [2012-10-15] uhidd 0.2.1 released: | ||
| + | |||
| + | * Support for kernel driver detach | ||
| + | * Support for mouse tilt wheel | ||
| + | * Support for linear Volume control found on some keyboard | ||
| + | * Support for cuse4bsd-based virtual device | ||
| ====== Download & Install ====== | ====== Download & Install ====== | ||
| - | The latest release tarball is [[http:// | + | The latest release tarball is [[https:// |
| - | You could also fetch the latest source code from googlecode SVN: | + | You could also fetch the latest source code from github: |
| < | < | ||
| - | % svn checkout http://uhidd.googlecode.com/svn/trunk/ uhidd | + | % git clone https://github.com/kaiwang27/uhidd.git |
| </ | </ | ||
| - | The recommended way to install uhidd is through the ports system instead of compiling the source by yourself. | + | The recommended way to install |
| < | < | ||
| - | # cd / | + | # pkg install |
| - | # make install | + | |
| </ | </ | ||
| Line 39: | Line 47: | ||
| there is no kernel HID device driver attached to that device. You could either remove '' | there is no kernel HID device driver attached to that device. You could either remove '' | ||
| '' | '' | ||
| - | drivers are loaded as kernel modules, '' | + | drivers are loaded as kernel modules, '' |
| + | those kernel modules in '' | ||
| + | by '' | ||
| could be also used together with kernel drivers, for example '' | could be also used together with kernel drivers, for example '' | ||
| to one interface of the same device. See the Examples section below for details. | to one interface of the same device. See the Examples section below for details. | ||
| Line 64: | Line 74: | ||
| < | < | ||
| - | # / | + | # / |
| </ | </ | ||
| Line 90: | Line 100: | ||
| < | < | ||
| - | attach | + | notify |
| - | match "device-name" " | + | match "subsystem" |
| - | action "/ | + | match " |
| + | match "cdev" " | ||
| + | action "env LD_PRELOAD=/ | ||
| }; | }; | ||
| </ | </ | ||
| Line 98: | Line 110: | ||
| Note that '' | Note that '' | ||
| to " | to " | ||
| + | |||
| + | ====== Coexists/ | ||
| + | |||
| + | * If '' | ||
| + | * If '' | ||
| + | * If '' | ||
| + | |||
| + | The recommanded way to use '' | ||
| + | * Use the GENERIC kernel or a kernel compiled in USB drivers. | ||
| + | * Use '' | ||
| + | |||
| + | Note that if you have USB kernel drivers('' | ||
| ====== How does it work ====== | ====== How does it work ====== | ||
| Line 111: | Line 135: | ||
| * Mouse: The mouse class driver will open the '' | * Mouse: The mouse class driver will open the '' | ||
| * Consumer Control: The Consumer Control class driver is basically a special keyboard driver that handles multimedia keys found on USB keyboard. This driver translate multimedia key usages to key codes and then an application can handle the key event the same way as any other normal key. See the Multimedia Keys section below for details. | * Consumer Control: The Consumer Control class driver is basically a special keyboard driver that handles multimedia keys found on USB keyboard. This driver translate multimedia key usages to key codes and then an application can handle the key event the same way as any other normal key. See the Multimedia Keys section below for details. | ||
| - | * Generic HID: Application collections that don't have a specific class driver can be attached by the Generic HID driver. The driver will create a virtual generic hid device using the '' | + | * Generic HID: Application collections that don't have a specific class driver can be attached by the Generic HID driver. The driver will create a virtual generic hid device using the '' |
| ====== Multimedia Keys ====== | ====== Multimedia Keys ====== | ||
| Line 129: | Line 153: | ||
| The convertor can support two PS2 hand controls. Below is the appearance of the device. | The convertor can support two PS2 hand controls. Below is the appearance of the device. | ||
| - | {{http://people.freebsd.org/ | + | {{uhidd/playstation.2.hand.controller.to.usb.converter.jpg|PlayStation 2 Hand Controller to USB converter}} |
| When connected to the PC under %%FreeBSD%% with in-kernel '' | When connected to the PC under %%FreeBSD%% with in-kernel '' | ||
| Line 155: | Line 179: | ||
| '' | '' | ||
| - | and creates two '' | + | and creates two virtual HID device nodes. The use '' |
| driver, then execute: | driver, then execute: | ||
| Line 166: | Line 190: | ||
| each get a part of the hid data. (and there won't be any warning/ | each get a part of the hid data. (and there won't be any warning/ | ||
| - | At this point, you should find two newly created '' | + | At this point, you should find two newly created '' |
| < | < | ||
| Line 182: | Line 206: | ||
| multimedia keys won't work.) | multimedia keys won't work.) | ||
| - | Below is the report descriptor of the combos | + | Below is the report descriptor of the combos: |
| - | combo models, wrt to the descriptor. | + | |
| < | < | ||
| - | Bus /dev/usb Device / | + | [interface: |
| - | [config: | + | |
| - | [#0 report descriptor size: 63] | + | |
| - | USAGE PAGE Generic Desktop(0x1) | + | |
| USAGE Keyboard(0x6)[Generic Desktop(0x1)] | USAGE Keyboard(0x6)[Generic Desktop(0x1)] | ||
| COLLECTION Application(1) | COLLECTION Application(1) | ||
| - | ...... | ||
| ...... (omitted) | ...... (omitted) | ||
| - | ...... | ||
| END COLLECTION | END COLLECTION | ||
| - | [config: | + | [interface: |
| - | [#0 report descriptor size: 556] | + | |
| - | USAGE PAGE Consumer(0xc) | + | |
| USAGE Consumer Control(0x1)[Consumer(0xc)] | USAGE Consumer Control(0x1)[Consumer(0xc)] | ||
| COLLECTION Application(1) | COLLECTION Application(1) | ||
| - | ...... | ||
| - | ...... | ||
| ...... | ...... | ||
| END COLLECTION | END COLLECTION | ||
| - | |||
| - | USAGE PAGE Generic Desktop(0x1) | ||
| USAGE Mouse(0x2)[Generic Desktop(0x1)] | USAGE Mouse(0x2)[Generic Desktop(0x1)] | ||
| COLLECTION Application(1) | COLLECTION Application(1) | ||
| - | ...... | ||
| - | ...... | ||
| ...... | ...... | ||
| END COLLECTION | END COLLECTION | ||
| - | |||
| - | USAGE PAGE Consumer(0xc) | ||
| USAGE Consumer Control(0x1)[Consumer(0xc)] | USAGE Consumer Control(0x1)[Consumer(0xc)] | ||
| COLLECTION Application(1) | COLLECTION Application(1) | ||
| - | ...... | ||
| - | ...... | ||
| ...... | ...... | ||
| END COLLECTION | END COLLECTION | ||
| - | |||
| - | USAGE PAGE Generic Desktop(0x1) | ||
| USAGE System Control(0x80)[Generic Desktop(0x1)] | USAGE System Control(0x80)[Generic Desktop(0x1)] | ||
| COLLECTION Application(1) | COLLECTION Application(1) | ||
| - | ...... | ||
| - | ...... | ||
| ...... | ...... | ||
| END COLLECTION | END COLLECTION | ||
| </ | </ | ||
| - | To use '' | + | To use '' |
| and then execute: | and then execute: | ||
| < | < | ||
| - | # uhidd -kmh / | + | # uhidd -kmo / |
| </ | </ | ||
| - | '' | + | '' |
| Since the keyboard collection is on a separate interface and is the only child device of that interface, it is possible | Since the keyboard collection is on a separate interface and is the only child device of that interface, it is possible | ||
| - | to let the kernel '' | + | to let the kernel '' |
| < | < | ||
| # kldload ukbd.ko | # kldload ukbd.ko | ||
| - | # uhidd -mh / | + | # uhidd -mo / |
| </ | </ | ||
| Letting kernel '' | Letting kernel '' | ||
| - | The '' | + | At this point, the mouse should work just fine, while additional work is needed to make the multimedia keys work. First you can |
| - | '' | + | just press the multimedia keys on the keyboard, at least once for each key. Then check if you can find a keymap file |
| + | '' | ||
| + | will then load the provided keymap | ||
| - | ===== Logitech diNovo Edge ===== | + | Example multimedia keymap for Microsoft Wiress Desktop 1000: |
| - | I don't have this Logitech keyboard/ | + | |
| < | < | ||
| - | [report desc size=59] | + | # 0x045e is the vendor id and 0x009d is the product id. |
| - | USAGE PAGE Generic Desktop(0x1) | + | # See `uhidd.conf(5)` manual page for details about configuration file. |
| - | USAGE Keyboard(0x6)[Generic Desktop(0x1)] | + | 0x045e: |
| - | COLLECTION Application(1) | + | |
| - | USAGE PAGE Keyboard(0x7) | + | |
| - | USAGE MINIMUM Keyboard LeftControl(224) | + | |
| - | USAGE MAXIMUM Keyboard Right GUI(231) | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | INPUT ( Data Variable Absolute ) (2) | + | |
| - | INPUT ( Const Variable Absolute ) (3) | + | |
| - | | + | |
| - | USAGE PAGE LEDs(0x8) | + | |
| - | USAGE MINIMUM Num Lock(1) | + | |
| - | USAGE MAXIMUM Kana(5) | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | USAGE PAGE Keyboard(0x7) | + | |
| - | USAGE MINIMUM Reserved (no event indicated)(0) | + | |
| - | USAGE MAXIMUM Keyboard ExSel(164) | + | |
| - | INPUT ( Data Array Absolute ) | + | |
| - | END COLLECTION | + | AC_Reply=" |
| + | AC_Forward_Msg=" | ||
| + | AC_Send=" | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| - | [report desc size=301] | + | Now you can confirm this multimedia key translation works by observing key events under '' |
| - | USAGE PAGE Generic Desktop(0x1) | + | |
| - | USAGE Mouse(0x2)[Generic Desktop(0x1)] | + | |
| - | COLLECTION Application(1) (0) | + | |
| - | | + | |
| - | ...... | + | |
| - | ...... | + | |
| - | END COLLECTION | + | |
| - | USAGE PAGE Generic Desktop(0x1) | + | < |
| - | USAGE Mouse(0x2)[Generic Desktop(0x1)] | + | keycode 170 = XF86AudioRaiseVolume |
| - | COLLECTION Application(1) | + | keycode 184 = XF86AudioLowerVolume |
| - | | + | keycode 190 = XF86AudioMute |
| - | ...... | + | ...... |
| - | ...... | + | </ |
| - | END COLLECTION | + | |
| - | USAGE PAGE Consumer(0xc) | + | It can be loaded by execute: |
| - | USAGE Consumer Control(0x1)[Consumer(0xc)] | + | |
| - | COLLECTION Application(1) | + | |
| - | ...... | + | |
| - | ...... | + | |
| - | ...... | + | |
| - | END COLLECTION | + | |
| - | USAGE PAGE Microsoft(0xff00) | + | < |
| - | USAGE Unknown Usage(0x2)[Microsoft(0xff00)] | + | xmodmap |
| - | COLLECTION Application(1) | + | |
| - | | + | |
| - | ...... | + | |
| - | ...... | + | |
| - | END COLLECTION | + | |
| - | + | ||
| - | USAGE PAGE Microsoft(0xff00) | + | |
| - | USAGE Unknown Usage(0x3)[Microsoft(0xff00)] | + | |
| - | COLLECTION Application(1) | + | |
| - | ...... | + | |
| - | ...... | + | |
| - | ...... | + | |
| - | END COLLECTION | + | |
| </ | </ | ||
| - | Quite similar with the M$ combo, | + | You can put this line into your X initialization file. |
| - | application collections. The tricky part of this combo is that the second interface has defined two mice while the combo' | + | |
| - | why two mice is defined but my guess is that two slightly different diNovo models probably share the same report descriptor) | + | |
| - | The kernel '' | + | |
| - | be hard-coding the positions of X, Y axes and buttons in the driver, but it is not a general solution. See [[http:// | + | |
| - | You can use following commands | + | For most multimedia keyboards, the basic keyboard part and the multimedia keys are on separate interfaces. So it's |
| + | perfectly OK to let '' | ||
| - | < | + | The '' |
| - | # uhidd -v -kmh / | + | '' |
| - | </ | + | |
| - | + | ||
| - | '' | + | |
| - | ====== Report Bugs ====== | + | ====== |
| - | Normally '' | + | Normally '' |
| - | specified in the command line will increase the level of verbosity. | + | |
| If you are having problems using '' | If you are having problems using '' | ||
| < | < | ||
| - | # uhidd -vvv -kmh / | + | # uhidd -dD -vvv -kmohu / |
| </ | </ | ||