For the moment Js2mouse emulates PS/2 and IMPS/2 protocols, so adapt the configuration for these protocols...
You do not need to run Js2mouse with root privileges if you specify to use a "virtual mouse character device" (the fifo) into a directory where you've got write-permissions :
js2mouse -f $HOME/j2m_fifo
- add this section into the X configuration file :
Section "InputDevice" Identifier "Mouse2" Driver "mouse" Option "Protocol" "_PROTO_" #_PROTO_ is PS/2 or IMPS/2 Option "Device" "/dev/j2m_fifo" Option "ZAxisMapping" "4 5" #only if you use IMPS/2 protocol EndSection
- into the Section "ServerLayout", add :
InputDevice "Mouse2" "SendCoreEvents"
- restart X (on the fly : Ctrl-Alt-BackSpace)
It depends on your Linux distribution, so this is the most independant explanation that I can give... Adapt your own configuration files :
- log as root (if necessary)
- enter the following commands into a terminal :
gpm -k gpm -m /dev/_YOUR_REAL_MOUSE_DEV_ -t _ITS_PROTOCOL_ -M -t ps2 -m /dev/j2m_fifo
I wrote this functionality on the fly, so this is experimental...
- edit
/etc/j2m_map
, format is :JOYSTICK_EVENT = MOUSE_EVENT
- JOYSTICK_EVENTs are :
button_1 button_2 ... button_NUMBER_OF_BUTTON axe_1 axe_2 ... axe_NUMBER_OF_AXES
- MOUSE_EVENTs are :
click_left click_right click_middle click_extra1 click_extra2 wheel_up wheel_down move_horizontal move_vertical
Default keys mapping (i.e. without -r argument) is:
button_1 = click_left button_2 = click_right button_3 = click_middle button_4 = wheel_up button_5 = wheel_down button_6 = click_extra1 button_7 = click_extra2 axe_1 = move_horizontal axe_2 = move_vertical
-h show this help -d <dev> use specified device, default : /dev/input/js0 -f <fifo> use specified fifo, default : /dev/j2m_fifo -v <n> verbose level, 0 to 3, default : 3 -t <n> poll timeout in ms, default : 20 -r active keys remapping, default : disable -p use specified mouse protocol, default : ps2