home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / 3bmouse.txt next >
Text File  |  1997-07-07  |  23KB  |  518 lines

  1.  
  2.                      THE 3 BUTTON SERIAL MOUSE MINI-HOWTO
  3.                                        
  4.   Geoff Short (geoff@kipper.york.ac.uk)
  5.   
  6.    v1.19 25th October 1996
  7.      _________________________________________________________________
  8.    
  9.           0. Disclaimer 
  10.           1. Introduction 
  11.           2. Serial ports 
  12.           3. Switched Mice 
  13.           4. Normal Mice 
  14.           5. Switching a Mouse to 3-Button Mode 
  15.           6. Using gpm to Change Mouse Modes 
  16.           7. Using two mice 
  17.           8. XF86Config and Xconfig file examples 
  18.           9. Cables, extensions and adaptors 
  19.           10. Miscellaneous Problems and Setup 
  20.           11. Models Tested 
  21.           12. Further Information 
  22.           13. Mouse Tail
  23.      _________________________________________________________________
  24.    
  25.   0. Disclaimer 
  26.   
  27.    The following document is offered in good faith as comprising only
  28.    safe programming and procedures. No responsibility is accepted by the
  29.    author for any loss or damage caused in any way to any person or
  30.    equipment, as a direct or indirect consequence of following these
  31.    instructions.
  32.    
  33.   1. Introduction 
  34.   
  35.    The most recent version of this document can always be found at
  36.    http://kipper.york.ac.uk/mouse.html
  37.    
  38.    Most X applications are written with the assumption that the user will
  39.    be working with a 3 button mouse. Serial mice are commonly used on
  40.    computers and are cheap to buy. Many of these mice have 3 buttons and
  41.    claim to use the Microsoft protocol, which in theory means they are
  42.    ideal for the X windows setup. (The record for the cheapest working 3
  43.    button mouse currently stands at $1.89!)
  44.    
  45.    Most dual-protocol mice will work in two modes:
  46.  
  47.      * 2-button Microsoft mode.
  48.      * 3-button MouseSystems mode.
  49.        
  50.    This document leads you through the different steps needed to
  51.    configure your mouse in these two different modes, especially the
  52.    steps needed to use the more useful 3-button mode.
  53.    
  54.   2. Serial Ports 
  55.   
  56.    The first thing to do is to make sure the software can find the mouse.
  57.    Work out which serial port your mouse is connected to - usually this
  58.    will be /dev/ttyS0 (COM1 under DOS) or /dev/ttyS1 (COM2). (ttyS0 is
  59.    usually the 9 pin socket, ttyS1 the 25 pin socket, but of course there
  60.    is no hard and fast rule about these things.) In most cases you can
  61.    also use the cua devices instead of ttyS, but this can cause problems
  62.    with a few setups. For convenience make a new link /dev/mouse pointing
  63.    at this port. For instance, for ttyS0:
  64.  
  65.      * ln -s /dev/ttyS0 /dev/mouse
  66.        
  67.   3. Switched Mice 
  68.   
  69.    Some mice, not usually the cheapest ones, have a switch on the bottom
  70.    marked `2/3'. Sometimes this may be `PC/MS'. In this case the `2'
  71.    setting is for 2 button Microsoft mode, and the `3' for 3 button
  72.    MouseSystems mode. The `PC/MS' switch is a bit more complicated. You
  73.    will probably find the `MS' setting is for Microsoft, and the `PC' is
  74.    for MouseSystems. You may find the `PC' setting described as ps/2
  75.    mode, but it should do MouseSystems as well. If you have such a mouse,
  76.    you can switch the switch to `3' or `PC', put the MouseSystems
  77.    settings in your XConfigs (see below) and the mouse should work
  78.    perfectly in 3-button mode.
  79.    
  80.   4. Normal Mice 
  81.   
  82.    If you don't have any switches, and no instructions, then a little bit
  83.    of experimentation is needed. The first thing to try is to assume the
  84.    mouse maker is telling the truth, and the mouse is full Microsoft. Set
  85.    up your XConfigs to expect a Microsoft mouse (see the Xconfig section)
  86.    and give it try.
  87.    
  88.    If the mouse didn't work at all, then you don't have a Microsoft
  89.    mouse, or there is some other problem. Try the other protocols in the
  90.    configs, the man page for the config file is the best place to start
  91.    looking. Also look in the Miscellaneous Problems section below.
  92.    
  93.    What you will probably find is that when you run X, the mouse works
  94.    fine but only the outer two buttons do anything. You can of course
  95.    accept this, and emulate the third button (press both buttons at once
  96.    to click the middle one) like you do with a two button mouse. To do
  97.    this, change your Xconfig file as shown in the Xconfig example section
  98.    below. This may mean you have bought a 3 button mouse for no good
  99.    reason, and you are certainly no further forward. So, now you need to
  100.    look at your hardware.
  101.    
  102.   5. Switching a Mouse to 3-Button Mode 
  103.   
  104.    Even cheap mice can also work under the Mouse Systems protocol, with
  105.    all three buttons working. The trick is to get the mouse to think it's
  106.    a Mouse Systems one, something you rarely see in your instructions.
  107.  
  108.      * Before you power up your computer, hold down the left mouse button
  109.        (and keep it held down until it has booted to be on the safe side).
  110.        
  111.    When the mouse first gets power, if the left button is held down it
  112.    switches into Mouse Systems mode. A simple fact, but not always
  113.    publicised. Note that a soft reboot of your computer may not cut the
  114.    mouse power and therefore may not work. There are a number of other
  115.    ways of switching the mode, which may or may not work with your
  116.    particular mouse. Some of these are less drastic than rebooting your
  117.    computer, two are more so!
  118.  
  119.      * If your computer is get-at-able you can unplug the mouse and plug
  120.        it back in with the button held down (although you shouldn't
  121.        normally plug things in to a live computer, the RS232 spec says it
  122.        is OK).
  123.      * You may be able to reset the mouse by typing echo "*n" >
  124.        /dev/mouse, which should have the same effect as unplugging it.
  125.        Hold the left button down for Mouse Systems mode, not for
  126.        Microsoft. You could put this in whatever script you use to start
  127.        X up.
  128.      * Bob Nichols (rnichols@interaccess.com) has written a small c
  129.        program to do the same thing, which may work if echo "*n" does not
  130.        (and vice versa). You can find a copy of his source code at
  131.        http://kipper.york.ac.uk/src/fix-mouse.c
  132.      * Someone has reported that the `ClearDTR' line in the Xconfig is
  133.        enough to switch their mouse into Mouse Systems mode.
  134.      * If you are brave enough, open the mouse up (remember that this
  135.        will invalidate your warranty) and have a look inside. In some
  136.        cases, the mouse may have a switch inside, for some strange reason
  137.        known only to the manufacturer. More likely on the cheap mice is a
  138.        jumper which you can move. The switch or jumper may have the same
  139.        effect as a `MS/PC' switch described in the Switched Mice section
  140.        above. You may find that the circuit board is designed for a
  141.        switch between 2 & 3 buttons, but it hasn't been fitted. It will
  142.        look something like:
  143.  
  144.          -----------
  145.         | o | o | o |  SW1
  146.          -----------
  147.           1   2   3
  148.        Try linking pins 1-2 or 2-3, and see if it changes the behaviour
  149.        of the mouse. If it does, you can either fit a small switch, or
  150.        solder across the contacts for a quick and permanent solution.
  151.      * Another soldering solution which might be a last-resort for mice
  152.        which don't understand MouseSystems at all, from Peter Benie (
  153.        pjb1008@chiark.chu.cam.ac.uk). If the middle button's switch is
  154.        double-pole, connect one side of the switch to the left button's
  155.        switch, and the other side to right button's switch. If it's not a
  156.        double pole switch then use diodes rather than wire. Now, the
  157.        middle button pushes the left and right buttons down together.
  158.        Select "chordmiddle" in the XF86Config and you have a working
  159.        middle button.
  160.      * The ultimate recourse with the soldering iron was described to me
  161.        by Brian Craft (bcboy@pyramid.bio.brandeis.edu). Two common
  162.        generic mouse chips are the 16 pin Z8350, and the 18 pin HM8350A.
  163.        On each of these chips, one pin controls the mode of the chip, as
  164.        follows.
  165.  
  166.     Pin 3   Mode
  167.     -----   ----
  168.     Open    Default Microsoft. Mouse Systems if button held on power-up.
  169.     GND     Always Mouse Systems.
  170.     Vdd     Always Microsoft.
  171.  
  172.        (This info comes courtesy