SYSMOUSE(4)

NAME
sysmouse - supplies mouse data from syscons for other applications

SYNOPSIS
#include <machine/console.h>
int
ioctl(cfd, CONS_MOUSECTL, struct *mouse_info);

DESCRIPTION
The CONS_MOUSECTL ioctl() call provides syscons with mouse information, which includes mouse movement and button presses. The ioctl() also provides a method for a process to receive a signal(3) when a button is pressed.

moused(8) uses this ioctl() to inform the console of mouse actions. Applications (such as X Windows) can use /dev/sysmouse, allowing syscons and the application to share the mouse.

    struct mouse_info {
            int     operation;
            union {
                    struct mouse_data data;
                    struct mouse_mode mode;
            }u;
    };

operation
    This can be one of

    MOUSE_SHOW
        Enables and displays mouse cursor.

    MOUSE_HIDE
        Disables and hides mouse cursor.

    MOUSE_MOVEABS
        Moves mouse cursor to position supplied in u.data.

    MOUSE_MOVEREL
        Add position supplied in u.data to current position.

    MOUSE_GETINFO
        Returns current mouse position and button status in u.data.

    MOUSE_MODE
        This sets the signal(3) to be delivered to the current process when a button is pressed. The signal to be delivered is set in u.mode.

    MOUSE_ACTION
        This takes the information in u.data and acts upon it. It includes processing button presses if the current vty is a text interface, and sending Mouse System protocol data to /dev/sysmouse if it is open.

u   This union is one of

    data

            struct mouse_data {
                    int     x;
                    int     y;
                    int     buttons;
            };

    mode

            struct mouse_mode {
                    int     mode;
                    int     signal;
            };

FILES
/dev/consolectl
    device to control the console
/dev/sysmouse
    mouse action output

SEE ALSO
vidcontrol(1), signal(3), moused(8)

HISTORY
The sysmouse manual page example first appeared in FreeBSD 2.2.

AUTHOR
This manual page was written by John-Mark Gurney <gurney_j@efn.org>.