From Electron Cloud
Revision as of 17:35, 12 December 2007 by Ecloud (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The usual approach with dials and jog/shuttle devices so far is for each application that uses them to open /dev/input/eventX and read the events, while X itself ignores those devices. This of course is silly, but the X support for them is immature.

X.org 7.2 configuration

It is possible to use the evdev driver that comes with X.org distributions to read events from the Powermate. If you have just one of them, you can configure it like this:

Section "InputDevice"
       Identifier  "Powermate0"
       Driver      "evdev"
       Option      "Name" "Griffin PowerMate"
       Option          "DialRelativeAxisButtons" "6 7"
EndSection

which will cause it to act a lot like a mouse wheel.

If you have two of them, due to a bug, it becomes necessary to specify their device paths, like this:

Section "InputDevice"
       Identifier  "Powermate0"
       Driver      "evdev"
       Option      "Device" "/dev/input/event7"
       Option          "DialRelativeAxisButtons" "6 7"
EndSection
Section "InputDevice"
       Identifier  "Powermate1"
       Driver      "evdev"
       Option      "Device" "/dev/input/event8"
       Option          "DialRelativeAxisButtons" "4 5"
EndSection

Now we have one which acts like a vertical mouse wheel and one which acts like a horizontal mouse wheel.

To get the "button" part to act like a mouse button, it's necessary to hack the evdev driver source. This is because the kernel (2.6.23) detects it as a device that has 17 buttons (presumably 16 sectors of rotation, plus 1 button for the "push" action). (And because of the "DialRelativeAxisButtons" directive, it becomes 19 buttons rather than 17.) Here is a sort of manual patch for doing this on Gentoo:

in /var/tmp/portage/x11-drivers/xf86-input-evdev-1.1.5-r2/work/xf86-input-evdev-1.1.5/src/evdev_btn.c:

    for (i = 0; i <= pEvdev->state.btn->buttons; i++)
            if (i == 19)
                map[i] = 2;
            else
                map[i] = i;

    xf86Msg(X_CONFIG, "%s (%d): Registering %d buttons.\n", __FILE__, __LINE__,

Just for reference here's the output I'm seeing from /proc/bus/input/devices:

I: Bus=0003 Vendor=077d Product=0410 Version=0400
N: Name="Griffin PowerMate"
P: Phys=/input0
S: Sysfs=/class/input/input7
U: Uniq=
H: Handlers=event7
B: EV=17
B: KEY=1 0 0 0 0 0 0 0 0
B: REL=80
B: MSC=2

I: Bus=0003 Vendor=077d Product=0410 Version=0400
N: Name="Griffin PowerMate"
P: Phys=/input0
S: Sysfs=/class/input/input8
U: Uniq=
H: Handlers=event8
B: EV=17
B: KEY=1 0 0 0 0 0 0 0 0
B: REL=80
B: MSC=2