MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!


 
 

*DocIndex - X

Mouse in X

* Cut and Paste
* Keyboard Mouse
* Making The Mouse Faster
* Using A Wheel Mouse In X

Related Resources:

Laptop HOWTO, Mice
Mouse Support In XFree86
XFree86-Second-Mouse mini-HOWTO
man xset
man XF86Config

Revision / Modified: June 12, 2001
Author: Tom Berger

 

* Cut and Paste

Cut and paste via the keyboard is the old standard procedure: mark the text, press <CTRL c> to copy (or <CTRL x> to cut) and then <CTRL v> to paste (to paste into terminals use SHIFT-INS).

Cut and paste using a mouse works differently, though: Mark the line(s) with your mouse. This will automatically write the marked lines to the cut & paste buffer. All you have to do now, is go the place where you want to paste these lines and press the middle mouse button. Et voila, there it is.

If you do not have a three-button mouse, just hold down one button and press the other to paste. Actually this works better with a good two-button mouse than with a mediocre three-button mouse, because low-quality three-button mice tend to insert the content of the buffer twice. This almost never happens with two-button models.
If this doesn't work with your two-button model, run 'mousedrake' again (as 'root') and see if you've checked the option 'Emulate Third Button'. You must have this option enabled to get cut and paste working for two-button mice! You can adjust the interval during which X recognizes an 'emulated' click by changing the value of Option "Emulate3Timeout" in '/etc/X11/XF86Config-4'.

If you need more than one buffer at a time, you might consider having a closer look at programs like 'XClipboard', 'Klipper' or 'GClipper'.

* section index * top

* Keyboard Mouse

X comes with a keyboard mouse, activated by pressing CTRL-SHIFT-NUMLOCK. Now the keypad will emulate mouse actions:
  • <8>: moves mouse pointer upward
  • <4>: moves pointer to the left
  • <6>: moves pointer to the right
  • <2>: moves pointer downward
  • <5>: emulates pressing mouse button 1
  • <->: changes the emulated mouse button
  • <0>: enters 'click and hold' mode (e.g. for drag and drop)
  • <+>: emulates a double-click

The emulated movement is *very* slow, but you can increase its speed considerably by pressing any other key while moving. This takes some exercise, though... Note that this features times out after a while, so you might have to press CTRL-SHIFT-NUMLOCK again to reactivate it.

* section index * top

* Making The Mouse Faster

Mice are usually not as responsive in X as in MS-Windows. PS\2 / USB mice are better than serial mice and there are vast differences between different brands. If you can spare the bucks, go for an optical mouse.

Most window managers allow changing the mouse speed from their respective configuration tools. Other ways to do this are:

  • Use the Resolution setting in the 'Pointer Section' of '/etc/X11/XF86Config-4'.
  • Turn off the General Purpose Mouse Daemon (gpmd) if you do not use the mouse on the console, e.g. via the Mandrake Control Center ('System' - 'Services'. It will still work in xterms.
  • Use the xset m number command to increase acceleration.
  • Use the 'setserial' utility for serial mice (e.g. setserial /dev/ttyS0 baud_base 115200 spd_hi)

* section index * top

* Using A Wheel Mouse In X

X itself has been supporting wheel mice since version 3.3.3.1. by mapping 'scroll up' and 'scroll down' to a new pair of mouse keys. To have mouse wheel support on the application level, however, the application toolkit has to support it, too. GTK+ (GNOME, Gimp) and Qt (KDE) support wheel mice natively, so all applications using either one of these have built-in mouse wheel support if the developer(s) used the appropriate hooks.

Other applications like Netscape Communicator can get mouse wheel support via the 'imwheel' utility. Notice that 'imwheel' is no longer needed (indeed deprecated) in Mandrake Linux 8.2 and later.

If the wheel of your mouse doesn't work, do these steps (check again after each step be restarting X):

  1. Run 'mousedrake' again and check if you've chosen the correct mouse model.

  2. Have a look at your '/etc/X11/XF86Config(-4)' file, 'Pointer section'. Check if this section has the lines

    Protocol "IMPS/2"
    ZAxisMapping "4 5"

    or (in 'XF86Config-4'):

    Option "Protocol" "IMPS/2"
    Option "ZAxisMapping" "4 5"

    Also make sure that there are hashes (#) in front of the 'Emulate3' options.

  3. Copy the file '/etc/X11/imwheelrc' to your home directory and rename it to '.imwheelrc'.

  4. Execute the imwheel command from your X startup file ('.xinitrc', '.xsession') or the 'Autostart' folder of your desktop environment.

If it still doesn't work, mail Mandrake's support ;-). And in case you are wondering, yes, the 'IMPS/2' driver also works for USB mice.

Have a look at the 'imwheelrc' file, since this is the place where configuration takes place, even for applications which are supported natively by their toolkits. The trouble with 'imwheel' is that is has to be told tonot interfere with these kinds of applications:

"konqueror"
@Exclude

This line in 'imwheelrc' tells 'imwheel' to not do anything about mouse wheel events in 'Konqueror'.

It is not possible to exclude applications by widget set, it is almost as impossible to list all applications which 'imwheel' should ignore in 'imwheelrc'. This leaves you with two choices if the mouse wheel is acting 'funny' in your applications:

  • Turn 'imwheel' off (easiest by uninstalling it).
  • Make a local copy of 'imwheelrc', rename it to '.imwheelrc' and add 'Exclude' lines for all the applications you use regularly.

Of course, you can also edit 'imwheelrc' with the target of adding functionality. The syntax is quite simple:

"Konsole.*"
None, Up, Shift_L|Page_Up
None, Down, Shift_L|Page_Down

The first line sets the window name (usually that's the application name), the next lines determine the events in 'Modifier Event' pairs. 'None' is a special modifier: it tells imwheel what to do in case the mouse wheel is scrolled without any modifier key pressed. Here it is scrolling up and down (this is what 'Konsole' would do anyway, even without 'imwheel').
The next pair defines a modifier key, the left SHIFT key. If you press the left SHIFT key and then use the wheel, you'll notice that 'scroll up' now scrolls up the command line history and that you now can use the wheel in pagers like 'less', too.

This is just a tiny fraction of what 'imwheel' can do, check out man imwheel for the full scope.

More information on wheel mice in GNU/Linux can be found on Colas Nahaboo X mouse wheel scroll page, although it's somewhat outdated in parts (doesn't cover XFree 4).

* section index * top

* Buttons and utilities

 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.