


      MOUSE(7)                   (Bull-SPS9)                   MOUSE(7)



      NAME
           mouse - pointing device

      DESCRIPTION
           /dev/mouse refers to the pointing or locator device
           associated with a Bull-SPS9 display disp(7).  Each window in
           a multi-window environment has an event queue for locator
           device events (motion and/or button changes), which may be
           read via the mouse device associated with that window.

           The input device data is encoded as a sequence of bytes that
           are placed into the mouse event queue for the currently
           selected active input window.  Each mouse event is
           translated into 5 bytes, which are queued according to the
           selected window's flag bits, as described below.  The entire
           event queue is flushed first if there is not enough room
           left for all 5 bytes, thus insuring that only the most
           recent events are queued.

           The first byte contains the state of the buttons.  Bit 0
           (least significant) is the right button, bit 1 is the middle
           button, and bit 2 (more significant) is the left button.
           The other bits are normally zero, but may contain more
           button bits if a nonstandard locator device is being used.
           A bit value of 1 indicates the corresponding button is
           depressed, and a bit value of 0 indicates the button is
           released.

           The second and third bytes contain the X coordinate in two's
           complement representation, high-order byte first.  The
           fourth and fifth bytes contain the Y coordinate in the same
           format.  The coordinate system used for the X,Y position
           depends on the mode of the currently selected window and the
           event mode bits in the wFlags word for the window.

           If the EMLocCoords bit is set, then display device
           coordinates are used and the location can be anywhere on the
           display surface.  The X coordinates range from 0 to 1023 and
           the Y coordinates range from 0 to 799, with the origin in
           the upper left corner of the Bull-SPS9 monochrome display
           disp(7).

           If the EMLocCoords bit is not set, then only mouse positions
           within the currently active window are queued.  The
           coordinate system used in this case is translated relative
           to the location of the window on the display surface and may
           be scaled depending on the current mode of the window.

           If the window is emulating a Tektronix 4014 terminal, then
           the X coordinates range from 0 to 1024 and the Y coordinates
           range from 0 to 780, with the origin in the lower left
           corner of the window.  The display device coordinates of the



      Page 1                                         (73 A2 02MTA REV1)






      MOUSE(7)                   (Bull-SPS9)                   MOUSE(7)



           mouse are appropriately scaled based on the size of the
           window.

           If the window is not in Tektronix 4014 mode, then display
           device coordinates are used, but are first translated
           relative to the origin of the window.  The X coordinates
           range from 0 to one less than the width of the window and
           the Y coordinates range from 0 to one less than the height
           of the window, with the origin in the upper left corner of
           the window.

           The mouse input for a window is accessed using the open(2)
           system call, providing the name mouse is appended to the
           window pathname.  For example, to open the mouse input
           associated with window window2 on display device number
           ``0'', the pathname would be /dev/disp0/window2/mouse.

           Alternatively, the special name /dev/mouse can be used by a
           process to specify the mouse input from the window which
           corresponds to its control terminal.  This special name is
           mapped by ROS to the actual pathname of the window, plus the
           string /mouse.  Thus, processes may easily refer to the
           mouse input from their control window without having to know
           the actual window pathname.

           A process uses the standard read(2) system call to access
           the mouse input from the window associated with an open file
           descriptor.  Each read will return as many bytes from the
           event queue as are requested, although it is recommended
           that 5 bytes be read at a time to maintain synchronization
           with the queuing of the mouse event bytes.

           Normally, a process will block when it attempts to read from
           a window that has no mouse input queued for it, or if the
           window is not the active input window.  A non-blocking
           read(2) may be used to determine if there is any mouse input
           queued for a particular window.  If the O_NDELAY bit is set
           either by open(2) or fcntl(2) on a file descriptor bound to
           the mouse input for a window, then a read will return
           immediately with a value of 0 when there are no mouse input
           bytes queued for the window.

           Several of the bits in the wFlags word associated with each
           window provide control over the queueing of input events
           from the mouse.

           Mouse pointing device (locator) input is placed in the mouse
           event queue for the currently selected active input window
           according to the bits defined in the <sys/winctrl.h> header
           file.  If the bits for the currently selected window do not
           allow queueing of a mouse event, then the window associated
           with the Window Manager process is tested according to its



      Page 2                                         (73 A2 02MTA REV1)






      MOUSE(7)                   (Bull-SPS9)                   MOUSE(7)



           bits.  This allows a process in the currently selected
           window to filter some or all mouse events, passing unwanted
           events to the Window Manager, which may choose to handle the
           mouse event or have it discarded.

                EMQueueLoc
                     Bit that determines if mouse input is to be queued
                     for the window.  The initial value of this bit is
                     0, which causes all mouse events for the window to
                     be ignored.  If this bit is set to 1, then mouse
                     events which satisfy the conditions specified by
                     the other control bits will be queued.

                EMLocCoords
                     Bit that determines the allowable coordinates of
                     the mouse to be queued for the window.  The
                     initial value of this bit is 0, which allows only
                     mouse events whose coordinates are inside the
                     window's boundaries to be queued.  If this bit is
                     set to 1, then mouse events located anywhere on
                     the screen which satisfy the other conditions will
                     be queued.

                EMLocMotion
                     Bit that allows queueing of mouse events resulting
                     from motion or button changes.  The initial value
                     of this bit is 0, allowing mouse events to be
                     queued only while a button is being depressed or
                     released, thus ignoring events when no buttons are
                     depressed.  If this bit is set to 1, then mouse
                     events which satisfy the other conditions will be
                     queued, regardless of button state.

                EMButtonMask
                     Bit field that determines which button changes
                     will cause a mouse input event to be queued for
                     the window when EMLocMotion is 0.  The field is
                     composed of the logical OR of the following four
                     fields, and is initialized to the value 0.

                EMRightButton
                     Bit that corresponds to the right button on the
                     mouse.  A bit value of 1 indicates that a mouse
                     event is to be queued when either the right button
                     is depressed, or when the single event of the
                     right button being released occurs.  A bit value
                     of 0 indicates that right button changes are to be
                     ignored.

                EMMiddleButton
                     Bit that corresponds to the middle button on the
                     mouse.  A bit value of 1 indicates that a mouse



      Page 3                                         (73 A2 02MTA REV1)






      MOUSE(7)                   (Bull-SPS9)                   MOUSE(7)



                     event is to be queued when either the middle
                     button is depressed, or when the single event of
                     the middle button being released occurs.  A bit
                     value of 0 indicates that middle button changes
                     are to be ignored.

                EMLeftButton
                     Bit that corresponds to the left button on the
                     mouse.  A bit value of 1 indicates that a mouse
                     event is to be queued when either the left button
                     is depressed, or when the single event of the left
                     button being released occurs.  A bit value of 0
                     indicates that left button changes are to be
                     ignored.

                EMOtherButtons
                     Bit that corresponds to all other buttons on a
                     nonstandard mouse or other pointing device.  A bit
                     value of 1 indicates that a mouse event is to be
                     queued when at least one of the other buttons is
                     depressed, or when the single event of one of the
                     other buttons being released occurs.  A bit value
                     of 0 indicates that all other button changes are
                     to be ignored.

                EMSigIOLoc
                     Bit that determines if mouse input events cause a
                     SIGIO signal(2) to be sent to the process or
                     process group waiting for mouse input from the
                     window.  The initial value of this bit is 0, which
                     causes no signals to be sent.  If this bit is set
                     to 1, then each mouse event (not each byte) for
                     the window generates a signal to the processes
                     associated by fcntl(2) with the window.

           The wFlags bits that control mouse input events may be
           accessed by making an ioctl(2) system call using a file
           descriptor associated with a window.

                #include <termio.h>

                ioctl (filedesc, command, arg)
                int *arg;

           The command argument using this form is:

                MOUSEGET   Get the flag bits associated with the mouse
                           input into the integer pointed to by arg.
                           All other bits are cleared to zero.

                ioctl (filedesc, command, arg)
                int arg;



      Page 4                                         (73 A2 02MTA REV1)






      MOUSE(7)                   (Bull-SPS9)                   MOUSE(7)



           The command argument using this form is:

                MOUSESET   Set the flag bits associated with the mouse
                           input from arg.  All other bits are ignored.

      DEVICE CODE
                                        block-type orstandard
               device type      major   minor       character-type file name

               mouse     1      3       block       /dev/mouse

      FILES
           /dev/mouse

      SEE ALSO
           Bull-SPS9 Multi-Window Display Management Guide
           windows(3X), wgraf(3X), disp(7)






































      Page 5                                         (73 A2 02MTA REV1)



