Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ascii(M)

mouse(HW)

vi(C)


 usemouse(C)                     19 June 1992                     usemouse(C)


 Name

    usemouse - map mouse input to keystrokes

 Syntax

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

 Description

    The usemouse command 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 tran-
    sitions, are programmable.  This permits the mouse to be used with pro-
    grams that are not designed to accept mouse input.

    usemouse with no arguments sets the mouse for use with the default map
    /etc/default/usemouse.  A new shell is invoked.  To terminate usemouse,
    exit the shell with <Ctrl>d.

    Alternate map files can be found in the directory /usr/lib/mouse.  Users
    can create their own map files based on the default file.  Quoted strings
    may be used in a map file, as well as the octal sequences found in the
    ascii(M) manual page.  Map files can be located anywhere on the system
    and accessed with the -f option (see below).

    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


 Options

    -f conffile   Select an alternate configuration file, conffile.  conffile
                  should use the format of /etc/default/usemouse.

    -t type       Select a predefined configuration file.  type can be any
                  file in /usr/lib/mouse, such as vi, rogue, or sysadmsh.
                  These files are identical in format to
                  /etc/default/usemouse.

                  The vi-specific map maps the traditional h-j-k-l direction
                  keys to the mouse movements.  The terminal bell is automat-
                  ically 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.

    -h horiz_sens Defines the horizontal sensitivity.  Horizontal mouse move-
                  ments smaller than this threshold are ignored.  Mouse move-
                  ments 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 set-
                  ting 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        Run cmd with usemouse.  cmd 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.  When cmd terminates, usemouse terminates as
                  well.

    -b            Suppresses bell (^G) for the duration of mouse usage.  Use-
                  ful 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-right
                  dl=string       String to generate on mouse down-left
                  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 should be quoted with single or double
                  quotes if they contain blank spaces. Any parameter may be
                  omitted; its value is then taken from the configuration
                  file.

 Examples

    To set up the mouse for use with vi, type:  usemouse -t vi.  This will
    not start vi.

    To start up the mouse for use with vi, and start vi, type:  usemouse -t
    vi -c vi.  This invokes the vi map along with the command; when you quit
    out of vi the mouse disengages.

    To start up vi using the default mouse map, but redefining the middle
    button (mbd) to be insert in vi, type:  usemouse -c vi mbd=i.  To start
    the mouse in vi using the customized map mine, type: usemouse -f mine -c
    vi

 Files

    /dev/mouse             Directory for mouse-related special device files.
    /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

    ascii(M), mouse(HW), vi(C)

 Value added

    usemouse is an extension of AT&T System V provided by The Santa Cruz
    Operation, Inc.


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