Logiciels Libres et Systèmes Embarqués


4. Integrate Js2Mouse into the Linux kernel (a.k.a j2mdev : EXPERIMENTAL)

4.1. Installation

  1. download the latest sources : http://www.freshmeat.net/projects/js2mouse/
  2. enter the following commands into a terminal :
    tar -xvzf js2mouse-YYMMDD.tar.gz
    cd js2mouse/j2mdev
    cp j2mdev-linux-2.6.1.patch /_WHERE_ARE_LINUX_SOURCES_/
    cd /_WHERE_ARE_LINUX_SOURCES_/
    patch -p0 <j2mdev-linux-2.6.1.patch
    cd linux
    make menuconfig
    # say Y or M to [Device Driver]->[Input DeviceSupport]->[Joystick->mouse converter interface]
    # recompile the kernel or modules

4.2. Load the module (if necessary)

  1. log as root.
  2. load your joystick driver, for instance :
    modprobe gamecon gc=0,7
  3. load j2mdev :
    modprobe j2mdev
  4. create (if necessary) related character device :
    mknod /dev/input/j2m0 c 13 200
    mknod /dev/input/j2m1 c 13 201
    mknod /dev/input/j2m2 c 13 202
    mknod /dev/input/j2m3 c 13 203

4.3. Parameters

You can specify the buttons map (2 to 5 arguments) when loding the module j2mdev :

btn=_left_,_right_,_middle_,_extra1_,_extra2_

You can specify the axes map (2 arguments) too :

abs=_horizontal_,_vertical_

You can also specify the refresh time between two reads :

refresh=_time_

For instance :

modprobe j2mdev refresh=10 btn=305,307,308

To know which values represent your buttons/axes, take a look at kernel log :

dmesg