Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ usemouse(C) — OpenDesktop 1.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mouse(HW)

USEMOUSE(C)


     USEMOUSE(C)                          UNIX System V



     Name
          usemouse - maps mouse input to keystrokes for use with  non-
          mouse based programs


     Syntax
          usemouse [ -f conffile ] [ -t type ] [ -h horiz_sens ] [  -v
          vert_sens ]
            [ -c cmd ] [ -b ] parameters


     Description
          This utility allows you to use a mouse with any program that
          would otherwise accept only keyboard input.

          For example, you can use a mouse  with  vi(C)  to  move  the
          cursor  around  the  screen  and generate your most commonly
          used vi commands.  The usemouse(C) command translates  mouse
          input  into  specific keystrokes required by a program.  You
          can use any  of  several  predefined  mouse  keystroke  sets
          (called maps) that correspond to different popular programs.
          You can also define your own maps with keystrokes that match
          different mouse movements and mouse buttons.


     Options
          The options are:


          -f conffile
               The  -f  flag  may  be  used  to  select  an  alternate
               configuration  file.  The alternate configuration file,
               conffile,     should     use     the     format      of
               /etc/default/usemouse  and  be  entered  as an absolute
               pathname on the command line. For example:

          usemouse -f /u/daniel/mouseconf

          is the correct form to specify  an  alternate  configuration
          file.  The -f and -t flags are mutually exclusive.

          -t type
               The  -t  flag  may  be  used  to  select  a  predefined
               configuration  file.   type can be the name of any file
               in /usr/lib/mouse, such as vi, rogue, or any others the
               system  administrator  chooses  to  place  there. These
               files are identical in format to /etc/default/usemouse.

          -h horiz_sens
               Defines the horizontal sensitivity.   Horizontal  mouse
               movements  smaller  than  this  threshold  are ignored.
               Mouse  movements  that  are  multiples  of  this  value
               generate multiple strings.  The sensitivity defaults to
               5 units.  The minimum value is 1 unit, and the  maximum
               is  100 units.  The lower the value, the more sensitive
               your mouse is to motion.   Note  that  setting  a  high
               value  may  cause  your mouse to behave as though it is
               not functioning, due to the large  motion  required  to
               generate a signal.

          -v vert_sens
               Defines  the  vertical  sensitivity.   Vertical   mouse
               movements  smaller  than  this  threshold  are ignored.
               Mouse  movements  that  are  multiples  of  this  value
               generate multiple strings.  The sensitivity defaults to
               5 units.  The minimum value is 1 unit, and the  maximum
               is  100 units.  The lower the value, the more sensitive
               your mouse is to motion.   Note  that  setting  a  high
               value  may  cause  your mouse to behave as though it is
               not functioning, due to the large  motion  required  to
               generate a signal.

          -c cmd
               This option selects a command for usemouse to run. This
               defaults   to   the   shell   specified  in  the  SHELL
               environment variable. If SHELL is unspecified,  /bin/sh
               is used. Note that the command given with this flag can
               contain blank spaces if the entire  command  is  placed
               within double quotes. For example:

             usemouse -c ``vi /etc/termcap''

          is valid.

          -b   Suppresses bell (^G) for the duration of  mouse  usage.
               Useful with vi(C).

          parameters
               These are name=value pairs indicating what ASCII string
               to  insert  into  the  tty input stream, when the given
               event is received. Valid parameters include:

          rbu=string     String to generate on right button up
          rbd=string     String to generate on right button down
          mbu=string     String to generate on middle button up
          mbd=string     String to generate on middle button down
          lbu=string     String to generate on left button up
          lbd=string     String to generate on left button down
          rt=string      String to generate on mouse right
          lt=string      String to generate on mouse left
          up=string      String to generate on mouse up
          dn=string      String to generate on mouse down
          ul=string      String to generate on mouse up-left
          ur=string      String to generate on mouse up-right
          dr=string      String to generate on mouse down-left
          dl=string      String to generate on mouse down-right
          hsens=num      Sensitivity to horizontal motion
          vsens=num      Sensitivity to vertical motion
          bells=yes/no   Whether to remove ^G characters

          Parameters may be specified in any order. They  may  contain
          octal  escapes.  They  may  be  quoted with single or double
          quotes if they contain blank spaces. Any parameters  may  be
          omitted   and  their  value,  if  any,  is  taken  from  the
          configuration file.

        The usemouse(C) Command
          To start using the mouse with  a  text  program,  enter  the
          command:

             usemouse

          This command sets the mouse for use with  the  default  map,
          which  is  found  in /etc/default/mouse. Alternate map files
          can be found  in  the  directory  /usr/lib/mouse.   You  can
          create  your  own alternate map files and place them in this
          directory or in your own custom  map  file  directory.   The
          default map file has the following values:

               __________________________________________________
              | Mouse            Keystroke                      |
              |_________________________________________________|
              | Left Button      vi top of file (1G) command    |
              | Middle Button    vi delete character (x) command|
              | Right Button     vi bottom of file (G) command  |
              | Up               Up Arrow Key                   |
              | Down             Down Arrow Key                 |
              | Left             Left Arrow Key                 |
              | Right            Right Arrow Key                |
              | Up and Left      not defined                    |
              | Up and Right     not defined                    |
              | Down and Left    not defined                    |
              | Down and Right   not defined                    |
              | Bells            no                             |
              |_________________________________________________|

          Invoking the usemouse command without specifying any options
          makes  the  mouse  ready  for  use  with  a  wide variety of
          programs or applications.  Invoking usemouse with no options
          causes  the mouse to use the default keystroke map. Invoking
          the mouse in this way creates a new command shell.  You  can
          continue  to use the mouse for the duration of the shell. To
          terminate usemouse, simply enter Ctrl-D.

          You can also invoke usemouse for the duration of a  specific
          command:

             usemouse -c command

          This puts you in the program specified by command using  the
          mouse.    When   you  leave  the  program,  mouse  input  is
          terminated.

        Using the Mouse with Specific Programs
          You can use any of several predefined maps that are  set  up
          specifically  for  use with different programs.  (These maps
          are found in /usr/lib/mouse.)  For example:

             usemouse -t vi

          This invokes the vi-specific map, which includes mapping the
          traditional  h-j-k-l  direction keys to the mouse movements.
          The terminal bell is automatically silenced by  the  vi  map
          entry  bells=no.   This  is  done  to prevent the bell being
          activated continuously when the user  generates  a  spurious
          command with the mouse.  (There is also a -b option that can
          be used on the usemouse command line to do the same thing.)

          You can combine a  command  with  a  selected  map  file  by
          putting both on the command line.  For example:

             usemouse -t vi -c vi filename

          This invokes the vi map along with  the  command;  when  you
          quit out of vi the mouse disengages.

        Setting Up Abbreviated (Aliased) Mouse Commands
          If you plan to use the mouse frequently, you can  substitute
          short,  easy  to  use  commands that will call up the longer
          command lines.  This is known as command aliasing. For  more
          information on command aliasing, consult the section ``Using
          Aliases'' in the ``C-Shell'' chapter of the User's Guide.

        Specifying Map Keystrokes on the Command Line
          You can also specify the characters to be generated by mouse
          motions on the usemouse command line. You can specify button
          actions  or  motion  actions  to  supplement  or  replace  a
          definition from a map file.  For example, assume you want to
          use the default usemouse file, but you want to redefine  the
          middle mouse button mbd (middle button down) as the vi ``i''
          (insert) instead of the ``x''  (delete  character)  command.
          The following command line does this:

             usemouse -c vi mbd=i

          The mouse operations are defined by  a  series  of  acronyms
          that are the same as used in the actual map file:
                _______________________________________________
               | Parameter   Mouse Operation      Default     |
               |______________________________________________|
               |                                              |
               | rbu         right button up      not used    |
               | rbd         right button down    1G          |
               | mbu         middle button up     not used    |
               | mbd         middle button down   x           |
               | lbu         left button up       not used    |
               | lbd         left button down     G           |
               | ul          mouse up-left        \033[A\033[C|
               | ur          mouse up-right       \033[A\033[D|
               | dr          mouse down-left      \033[B\033[C|
               | dl          mouse down-right     \033[B\033[D|
               | rt          mouse right          \033[C      |
               | lt          mouse left           \033[D      |
               | up          mouse up             \033[A      |
               | dn          mouse down           \033[B      |
               | hsens       horiz. sensitivity   5           |
               | vsens       vert. sensitivity    5           |
               |______________________________________________|

        Creating Customized Maps
          You can create your own personal map files for use with  the
          mouse.   The  easiest  way to do this is to copy the default
          map in /etc/default/usemouse and edit it. You can use quoted
          strings  or  the octal sequences found in the ascii(M) page.
          The mouse direction/button parameters  are  defined  in  the
          usemouse   table   above.   For  example,  after  placing  a
          customized file, mine, in your  home  directory,  you  would
          invoke  the  following  command  to  use it with the program
          prog:

             usemouse -f mine -c prog

        How usemouse Works
          usemouse merges data from a mouse into the input stream of a
          tty. The mouse data is translated to arrow keys or any other
          arbitrary ASCII strings.  Mouse  movements  up,  down,  left
          right, up-left, up-right, down-left, and down-right, as well
          as  individual  up  and   down   button   transitions,   are
          programmable.   This  permits  the  mouse  to  be  used with
          programs that are not designed to accept mouse input.

          By default, the usemouse utility gets  value  configurations
          from the file /etc/default/usemouse .

          After running the utility, provided a  mouse  is  available,
          the  user  will  be running a command with mouse motions and
          button events translated to ASCII strings  and  merged  into
          their tty input stream.  By default, the command is a shell.


     Files
     /dev/mouse                 Directory for mouse-related special device files.
     /dev/mouse/bus[0-1]        Bus mouse device files.
     /dev/mouse/vpix[0-1]       vpix-mouse device files.
     /dev/mouse/microsoft_ser   Microsoft serial mouse device files.
     /dev/mouse/logitech_ser    Logitech serial mouse device files.
     /dev/mouse/mousesys_ser    Mousesys serial mouse device files.
     /dev/mouse/ttyp[0-7]       Special pseudo-tty files for mouse input.
     /dev/mouse/ptyp[0-7]       Special pseudo-tty files for mouse input.
     /etc/default/usemouse      Default map file for mouse-generated characters.
     /usr/lib/event/devices     File containing device information for mice.
     /usr/lib/event/ttys        File listing ttys eligible to use mice.
     /usr/lib/mouse/*           Alternate map files for mice.


     See Also
          mouse(HW)



     (printed 2/15/90)                                USEMOUSE(C)

























































































































































































































































































































Typewritten Software • bear@typewritten.org • Edmonds, WA 98026