Difference between revisions of "How to configure the TrackPoint"

From ThinkWiki
Jump to: navigation, search
m (Using the X server (kernel 2.6.11+))
Line 54: Line 54:
 
         Option          "EmulateWheelButton"    "2"
 
         Option          "EmulateWheelButton"    "2"
  
It may also be necessary to add these lines:
+
It may also be necessary to add these lines, which change axis orientation:
  
 
         Option "XAxisMapping" "4 5"
 
         Option "XAxisMapping" "4 5"

Revision as of 20:41, 20 June 2006

The kernel trackpoint driver is controlled by echoing values to special files. Common configuration options are outlined below.
NOTE!
  • Starting from 2.6.13 config files for this driver are located in /sys/devices/platform/i8042/serio0/serio2. (This document uses the new locations.)
  • From 2.6.11 on, they are in /sys/devices/platform/i8042/serio0.
  • Prior to kernel 2.6.11, these files were located in /proc/trackpoint.
  • Prior to kernel 2.6.9, these files were not files at all, but were command-line options to the psmouse module. (Note this means you must compile psmouse as a module!) See http://stephen.evanchik.com/node/16.

General Configuration

The configuration options are reflected by the files you can find in /sys/devices/platform/i8042/serio0/serio2. See the TrackPoint driver page for a complete list. Configuration is done by echoing the appropriate values into these special files.

Most common Features

The most common settings are Press to Select, sensitivity, speed and scrolling.

Press to Select

Press to Select allows you to tap the control stick which will simulate a left click. You can enable this feature by typing the following in to a terminal (you may need to be root):

# echo -n 1 > /sys/devices/platform/i8042/serio0/serio2/press_to_select

Press to Select should now be enabled. You can disable it in a similar manner:

# echo -n 0 > /sys/devices/platform/i8042/serio0/serio2/press_to_select

Sensitivity & Speed

Adjusting the speed and sensitivity of the TrackPoint requires echoing a value between 0 and 255 into the appropriate file. For example, for a speed of 120 and a sensitivity of 250, type the following into a terminal:

# echo -n 120 > /sys/devices/platform/i8042/serio0/serio2/speed
# echo -n 250 > /sys/devices/platform/i8042/serio0/serio2/sensitivity

Feel free to experiment with your settings until you find a combination that is comfortable.

Scrolling

Using a kernel prior to 2.6.11

The scrolling action is essentially the same as is used in the TrackPoint Windows drivers. To enable this feature, type the following in to a terminal (you may need to be root):

# echo -n 1 > /proc/trackpoint/scroll

Then press the middle button and push the stick up and down to scroll. Similarly, to disable scrolling:

# echo -n 0 > /proc/trackpoint/scroll

Using the X server (kernel 2.6.11+)

The scroll setting has been removed from the trackpoint driver in kernel versions 2.6.11 and above. Scroll emulation should now be handled in the X server.

The necessary functionality, known as "EmulateWheellTimeout" allowing to use button 2 for a middle click, wasn't implemented in Xorg prior to 6.9/7.0. However, there was a patch included in most distributions packages of Xorg, which was announced here. You can find an updated version of the package in the experimental branch of Debian or try to build the mouse driver yourself with the information in the announcement. This has successfully been tried with FC3's 6.8.2 packages.

Once this functionality is in the X.org, add these lines to your TrackPoint configuration section in /etc/X11/xorg.conf:

       Option          "EmulateWheel"          "on"
       Option          "EmulateWheelButton"    "2"

It may also be necessary to add these lines, which change axis orientation:

       Option "XAxisMapping" "4 5"
       Option "YAxisMapping" "6 7"

Now restart X and hold down button 2 and move the mouse to scroll, or just press and release button 2 for a middle click.

EmulateWheelTimeout temporarily broken

Unfortunately, there was a regression so that EmulateWheelTimeout was broken in X.org 6.9.0, and fixed on March 20th, 2006. You can see the primary bug report here, and also reports on the Mandriva and Debian packages.

Older versions of X.org

For older versions of Xorg or for Xfree86 (/etc/X11/XF86Config) try this:

      Option          "Emulate3Buttons"       "true"
      Option          "EmulateWheel"          "true"
      Option          "EmulateWheelButton"    "2"

Now restart X and hold down button two and move the mouse for scrolling. To get a middle click, press buttons 1 and 3 simultaneously.

Soft Transparent Mode

If you wish to connect a special device to the external PS/2 port, you should consider using "Soft Transparent Mode" so that the TrackPoint controller does not interpret any commands sent to the external PS/2 port. You can enable soft transparent mode by typing the following in to a terminal:

# echo -n 1 > /sys/devices/platform/i8042/serio0/serio2/transparent

Disabling soft transparent mode is similar:

# echo -n 0 > /sys/devices/platform/i8042/serio0/serio2/transparent

Modify trackpoint parameter permanently in trackpoint.h

If you do not want to run a script to reconfigure the trackpoint you can change the default settings in the trackpoint header file that is located in

/usr/src/<KERNEL_VERSION>/drivers/input/mouse/trackpoint.h.

First you must convert the values (decimal numbers) you normaly echo to /sys/[...] to hex:

echo -e 'obase=16;<DECIMAL_NUMBER>' | bc

Then simply replace the default hex values in trackpoint.h, run 'make && make modules_install' to recompile and install psmouse.ko (should be compiled as module)


Example patch (speed=100, sensitivity=190, press_to_select=1):

 --- trackpoint.h.orig   2006-01-17 16:18:30.000000000 +0100
+++ trackpoint.h        2006-01-17 16:25:47.000000000 +0100
@@ -108,9 +108,9 @@
 /*
  * Default power on values
  */
-#define TP_DEF_SENS            0x80
+#define TP_DEF_SENS            0xBE
 #define TP_DEF_INERTIA         0x06
-#define TP_DEF_SPEED           0x61
+#define TP_DEF_SPEED           0x64
 #define TP_DEF_REACH           0x0A

 #define TP_DEF_DRAGHYS         0xFF
@@ -123,7 +123,7 @@

 /* Toggles */
 #define TP_DEF_MB              0x00
-#define TP_DEF_PTSON           0x00
+#define TP_DEF_PTSON           0x01
 #define TP_DEF_SKIPBACK                0x00
 #define TP_DEF_EXT_DEV         0x01

Configure firefox for using trackpoint horizontal scrolling

Vertical Scrolling seems to work out of the box in firefox if you followed the steps above. Anyway, there is a problem when you doesnt scroll exactly vertical, because horizontal scrolling turns into browser BACK/FORWARD commands. You can avoid this by typing about:config + ENTER in the address bar of firefox. You have to adjust the following options:

mousewheel.horizscroll.withcontrolkey.action = 3;
mousewheel.horizscroll.withcontrolkey.numlines = 1; 
mousewheel.horizscroll.withcontrolkey.sysnumlines = true;

mousewheel.horizscroll.withnokey.action = 0;
mousewheel.horizscroll.withnokey.numlines = 1;
mousewheel.horizscroll.withnokey.sysnumlines = true;

mousewheel.horizscroll.withshiftkey.action = 1;
mousewheel.horizscroll.withshiftkey.numlines = 1;
mousewheel.horizscroll.withshiftkey.sysnumlines = true;

Configure Opera for using trackpoint horizontal scrolling

You'll experience the same annoying problem with the popular browser Opera. To fix this you need to edit the configfile /usr/share/opera/ini/standard_mouse.ini and comment the following lines out

Button6                                                        = Back
Button7                                                        = Forward

so they look something like that

;Button6                                                        = Back
;Button7                                                        = Forward

Remember, Button6 and Button7 do not so coincidental correspond with our X configuration we know from above:

Option "YAxisMapping" "6 7"