17455cb5eSJohn-Mark Gurney.\" Copyright 1997 John-Mark Gurney. All rights reserved. 2e4343c4eSMike Pritchard.\" 3e4343c4eSMike Pritchard.\" Redistribution and use in source and binary forms, with or without 4e4343c4eSMike Pritchard.\" modification, are permitted provided that the following conditions 5e4343c4eSMike Pritchard.\" are met: 6e4343c4eSMike Pritchard.\" 1. Redistributions of source code must retain the above copyright 7e4343c4eSMike Pritchard.\" notice, this list of conditions and the following disclaimer. 8e4343c4eSMike Pritchard.\" 2. Redistributions in binary form must reproduce the above copyright 9e4343c4eSMike Pritchard.\" notice, this list of conditions and the following disclaimer in the 10e4343c4eSMike Pritchard.\" documentation and/or other materials provided with the distribution. 11e4343c4eSMike Pritchard.\" 12e4343c4eSMike Pritchard.\" THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS'' AND 13e4343c4eSMike Pritchard.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14e4343c4eSMike Pritchard.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15e4343c4eSMike Pritchard.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 16e4343c4eSMike Pritchard.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17e4343c4eSMike Pritchard.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18e4343c4eSMike Pritchard.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19e4343c4eSMike Pritchard.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20e4343c4eSMike Pritchard.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21e4343c4eSMike Pritchard.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22e4343c4eSMike Pritchard.\" SUCH DAMAGE. 23e4343c4eSMike Pritchard.\" 2422219d8bSJohn-Mark Gurney.Dd March 25, 2014 25474fc32bSAlexey Zelkin.Dt SYSMOUSE 4 263d45e180SRuslan Ermilov.Os 27e4343c4eSMike Pritchard.Sh NAME 28e4343c4eSMike Pritchard.Nm sysmouse 29369a889cSKazutaka YOKOTA.\" .Nd supplies mouse data from syscons for other applications 30369a889cSKazutaka YOKOTA.Nd virtualized mouse driver 31e4343c4eSMike Pritchard.Sh SYNOPSIS 3232eef9aeSRuslan Ermilov.In sys/mouse.h 3332eef9aeSRuslan Ermilov.In sys/consio.h 34e4343c4eSMike Pritchard.Sh DESCRIPTION 35369a889cSKazutaka YOKOTAThe console driver, in conjunction with the mouse daemon 36369a889cSKazutaka YOKOTA.Xr moused 8 , 37369a889cSKazutaka YOKOTAsupplies mouse data to the user process in the standardized way via the 38369a889cSKazutaka YOKOTA.Nm 39369a889cSKazutaka YOKOTAdriver. 40369a889cSKazutaka YOKOTAThis arrangement makes it possible for the console and the user process 41c4d9468eSRuslan Ermilov(such as the 42c4d9468eSRuslan Ermilov.Tn X\ Window System ) 43369a889cSKazutaka YOKOTAto share the mouse. 44369a889cSKazutaka YOKOTA.Pp 45369a889cSKazutaka YOKOTAThe user process which wants to utilize mouse operation simply opens 46369a889cSKazutaka YOKOTA.Pa /dev/sysmouse 47369a889cSKazutaka YOKOTAwith a 48369a889cSKazutaka YOKOTA.Xr open 2 49369a889cSKazutaka YOKOTAcall and reads 50369a889cSKazutaka YOKOTAmouse data from the device via 51369a889cSKazutaka YOKOTA.Xr read 2 . 52369a889cSKazutaka YOKOTAMake sure that 53369a889cSKazutaka YOKOTA.Xr moused 8 540227791bSRuslan Ermilovis running, otherwise the user process will not see any data coming from 55369a889cSKazutaka YOKOTAthe mouse. 56369a889cSKazutaka YOKOTA.Ss Operation Levels 57e4343c4eSMike PritchardThe 58369a889cSKazutaka YOKOTA.Nm 59369a889cSKazutaka YOKOTAdriver has two levels of operation. 60369a889cSKazutaka YOKOTAThe current operation level can be referred to and changed via ioctl calls. 61369a889cSKazutaka YOKOTA.Pp 62369a889cSKazutaka YOKOTAThe level zero, the basic level, is the lowest level at which the driver 63369a889cSKazutaka YOKOTAoffers the basic service to user programs. 64369a889cSKazutaka YOKOTAThe 65369a889cSKazutaka YOKOTA.Nm 66369a889cSKazutaka YOKOTAdriver 67369a889cSKazutaka YOKOTAprovides horizontal and vertical movement of the mouse 68369a889cSKazutaka YOKOTAand state of up to three buttons in the 69369a889cSKazutaka YOKOTA.Tn MouseSystems 70369a889cSKazutaka YOKOTAformat as follows. 71369a889cSKazutaka YOKOTA.Pp 72369a889cSKazutaka YOKOTA.Bl -tag -width Byte_1 -compact 73369a889cSKazutaka YOKOTA.It Byte 1 74369a889cSKazutaka YOKOTA.Bl -tag -width bit_7 -compact 75369a889cSKazutaka YOKOTA.It bit 7 76369a889cSKazutaka YOKOTAAlways one. 77369a889cSKazutaka YOKOTA.It bit 6..3 78369a889cSKazutaka YOKOTAAlways zero. 79369a889cSKazutaka YOKOTA.It bit 2 80369a889cSKazutaka YOKOTALeft button status; cleared if pressed, otherwise set. 81369a889cSKazutaka YOKOTA.It bit 1 826d249eeeSSheldon HearnMiddle button status; cleared if pressed, otherwise set. 836d249eeeSSheldon HearnAlways one, 84369a889cSKazutaka YOKOTAif the device does not have the middle button. 85369a889cSKazutaka YOKOTA.It bit 0 86369a889cSKazutaka YOKOTARight button status; cleared if pressed, otherwise set. 87369a889cSKazutaka YOKOTA.El 88369a889cSKazutaka YOKOTA.It Byte 2 89f227cbfbSChris CostelloThe first half of horizontal movement count in two's complement; 9066b23135SUlrich Spörlein\-128 through 127. 91369a889cSKazutaka YOKOTA.It Byte 3 92f227cbfbSChris CostelloThe first half of vertical movement count in two's complement; 9366b23135SUlrich Spörlein\-128 through 127. 94369a889cSKazutaka YOKOTA.It Byte 4 95f227cbfbSChris CostelloThe second half of the horizontal movement count in two's complement; 9666b23135SUlrich Spörlein\-128 through 127. 975203edcdSRuslan ErmilovTo obtain the full horizontal movement count, add 98369a889cSKazutaka YOKOTAthe byte 2 and 4. 99369a889cSKazutaka YOKOTA.It Byte 5 100f227cbfbSChris CostelloThe second half of the vertical movement count in two's complement; 10166b23135SUlrich Spörlein\-128 through 127. 1025203edcdSRuslan ErmilovTo obtain the full vertical movement count, add 103369a889cSKazutaka YOKOTAthe byte 3 and 5. 104369a889cSKazutaka YOKOTA.El 105369a889cSKazutaka YOKOTA.Pp 106369a889cSKazutaka YOKOTAAt the level one, the extended level, mouse data is encoded 107369a889cSKazutaka YOKOTAin the standard format 108369a889cSKazutaka YOKOTA.Dv MOUSE_PROTO_SYSMOUSE 109369a889cSKazutaka YOKOTAas defined in 110369a889cSKazutaka YOKOTA.Xr mouse 4 . 111369a889cSKazutaka YOKOTA.\" .Ss Acceleration 112369a889cSKazutaka YOKOTA.\" The 113369a889cSKazutaka YOKOTA.\" .Nm 114369a889cSKazutaka YOKOTA.\" driver can somewhat `accelerate' the movement of the pointing device. 115369a889cSKazutaka YOKOTA.\" The faster you move the device, the further the pointer 116369a889cSKazutaka YOKOTA.\" travels on the screen. 117369a889cSKazutaka YOKOTA.\" The driver has an internal variable which governs the effect of 118369a889cSKazutaka YOKOTA.\" the acceleration. Its value can be modified via the driver flag 119369a889cSKazutaka YOKOTA.\" or via an ioctl call. 120369a889cSKazutaka YOKOTA.Sh IOCTLS 121369a889cSKazutaka YOKOTAThis section describes two classes of 122369a889cSKazutaka YOKOTA.Xr ioctl 2 123369a889cSKazutaka YOKOTAcommands: 124369a889cSKazutaka YOKOTAcommands for the 125369a889cSKazutaka YOKOTA.Nm 126369a889cSKazutaka YOKOTAdriver itself, and commands for the console and the console control drivers. 127369a889cSKazutaka YOKOTA.Ss Sysmouse Ioctls 128369a889cSKazutaka YOKOTAThere are a few commands for mouse drivers. 129369a889cSKazutaka YOKOTAGeneral description of the commands is given in 130369a889cSKazutaka YOKOTA.Xr mouse 4 . 1317f9d55b4STim VanderhoekFollowing are the features specific to the 132369a889cSKazutaka YOKOTA.Nm 133369a889cSKazutaka YOKOTAdriver. 134369a889cSKazutaka YOKOTA.Pp 135369a889cSKazutaka YOKOTA.Bl -tag -width MOUSE -compact 136369a889cSKazutaka YOKOTA.It Dv MOUSE_GETLEVEL Ar int *level 137369a889cSKazutaka YOKOTA.It Dv MOUSE_SETLEVEL Ar int *level 138369a889cSKazutaka YOKOTAThese commands manipulate the operation level of the mouse driver. 139369a889cSKazutaka YOKOTA.Pp 140369a889cSKazutaka YOKOTA.It Dv MOUSE_GETHWINFO Ar mousehw_t *hw 141369a889cSKazutaka YOKOTAReturns the hardware information of the attached device in the following 142b5e7e999SRuslan Ermilovstructure. 143b5e7e999SRuslan ErmilovOnly the 14466b23135SUlrich Spörlein.Va iftype 145369a889cSKazutaka YOKOTAfield is guaranteed to be filled with the correct value in the current 146369a889cSKazutaka YOKOTAversion of the 147369a889cSKazutaka YOKOTA.Nm 148369a889cSKazutaka YOKOTAdriver. 149369a889cSKazutaka YOKOTA.Bd -literal 150369a889cSKazutaka YOKOTAtypedef struct mousehw { 151369a889cSKazutaka YOKOTA int buttons; /* number of buttons */ 152369a889cSKazutaka YOKOTA int iftype; /* I/F type */ 153369a889cSKazutaka YOKOTA int type; /* mouse/track ball/pad... */ 154369a889cSKazutaka YOKOTA int model; /* I/F dependent model ID */ 155369a889cSKazutaka YOKOTA int hwid; /* I/F dependent hardware ID */ 156369a889cSKazutaka YOKOTA} mousehw_t; 157369a889cSKazutaka YOKOTA.Ed 158369a889cSKazutaka YOKOTA.Pp 159369a889cSKazutaka YOKOTAThe 16066b23135SUlrich Spörlein.Va buttons 161369a889cSKazutaka YOKOTAfield holds the number of buttons detected by the driver. 162369a889cSKazutaka YOKOTA.Pp 163369a889cSKazutaka YOKOTAThe 16466b23135SUlrich Spörlein.Va iftype 165369a889cSKazutaka YOKOTAis always 166369a889cSKazutaka YOKOTA.Dv MOUSE_IF_SYSMOUSE . 167369a889cSKazutaka YOKOTA.Pp 168369a889cSKazutaka YOKOTAThe 16966b23135SUlrich Spörlein.Va type 170369a889cSKazutaka YOKOTAtells the device type: 171369a889cSKazutaka YOKOTA.Dv MOUSE_MOUSE , 172369a889cSKazutaka YOKOTA.Dv MOUSE_TRACKBALL , 173369a889cSKazutaka YOKOTA.Dv MOUSE_STICK , 174369a889cSKazutaka YOKOTA.Dv MOUSE_PAD , 175369a889cSKazutaka YOKOTAor 176369a889cSKazutaka YOKOTA.Dv MOUSE_UNKNOWN . 177369a889cSKazutaka YOKOTA.Pp 178369a889cSKazutaka YOKOTAThe 17966b23135SUlrich Spörlein.Va model 180369a889cSKazutaka YOKOTAis always 181369a889cSKazutaka YOKOTA.Dv MOUSE_MODEL_GENERIC 182369a889cSKazutaka YOKOTAat the operation level 0. 183369a889cSKazutaka YOKOTAIt may be 184369a889cSKazutaka YOKOTA.Dv MOUSE_MODEL_GENERIC 185369a889cSKazutaka YOKOTAor one of 186369a889cSKazutaka YOKOTA.Dv MOUSE_MODEL_XXX 187369a889cSKazutaka YOKOTAconstants at higher operation levels. 188369a889cSKazutaka YOKOTA.Pp 189369a889cSKazutaka YOKOTAThe 19066b23135SUlrich Spörlein.Va hwid 191369a889cSKazutaka YOKOTAis always zero. 192369a889cSKazutaka YOKOTA.Pp 193369a889cSKazutaka YOKOTA.It Dv MOUSE_GETMODE Ar mousemode_t *mode 194369a889cSKazutaka YOKOTAThe command gets the current operation parameters of the mouse 195369a889cSKazutaka YOKOTAdriver. 196369a889cSKazutaka YOKOTA.Bd -literal 197369a889cSKazutaka YOKOTAtypedef struct mousemode { 198369a889cSKazutaka YOKOTA int protocol; /* MOUSE_PROTO_XXX */ 199369a889cSKazutaka YOKOTA int rate; /* report rate (per sec) */ 200369a889cSKazutaka YOKOTA int resolution; /* MOUSE_RES_XXX, -1 if unknown */ 201369a889cSKazutaka YOKOTA int accelfactor; /* acceleration factor */ 202369a889cSKazutaka YOKOTA int level; /* driver operation level */ 203369a889cSKazutaka YOKOTA int packetsize; /* the length of the data packet */ 204369a889cSKazutaka YOKOTA unsigned char syncmask[2]; /* sync. bits */ 205369a889cSKazutaka YOKOTA} mousemode_t; 206369a889cSKazutaka YOKOTA.Ed 207369a889cSKazutaka YOKOTA.Pp 208369a889cSKazutaka YOKOTAThe 20966b23135SUlrich Spörlein.Va protocol 210369a889cSKazutaka YOKOTAfield tells the format in which the device status is returned 211369a889cSKazutaka YOKOTAwhen the mouse data is read by the user program. 212369a889cSKazutaka YOKOTAIt is 213369a889cSKazutaka YOKOTA.Dv MOUSE_PROTO_MSC 214369a889cSKazutaka YOKOTAat the operation level zero. 215369a889cSKazutaka YOKOTA.Dv MOUSE_PROTO_SYSMOUSE 216369a889cSKazutaka YOKOTAat the operation level one. 217369a889cSKazutaka YOKOTA.Pp 218369a889cSKazutaka YOKOTAThe 21966b23135SUlrich Spörlein.Va rate 22066b23135SUlrich Spörleinis always set to \-1. 221369a889cSKazutaka YOKOTA.Pp 222369a889cSKazutaka YOKOTAThe 22366b23135SUlrich Spörlein.Va resolution 22466b23135SUlrich Spörleinis always set to \-1. 225369a889cSKazutaka YOKOTA.Pp 226369a889cSKazutaka YOKOTAThe 22766b23135SUlrich Spörlein.Va accelfactor 228369a889cSKazutaka YOKOTAis always 0. 229369a889cSKazutaka YOKOTA.Pp 230369a889cSKazutaka YOKOTAThe 23166b23135SUlrich Spörlein.Va packetsize 2326d249eeeSSheldon Hearnfield specifies the length of the data packet. 2336d249eeeSSheldon HearnIt depends on the 234369a889cSKazutaka YOKOTAoperation level. 235369a889cSKazutaka YOKOTA.Pp 236369a889cSKazutaka YOKOTA.Bl -tag -width level_0__ -compact 237369a889cSKazutaka YOKOTA.It Em level 0 238369a889cSKazutaka YOKOTA5 bytes 239369a889cSKazutaka YOKOTA.It Em level 1 240369a889cSKazutaka YOKOTA8 bytes 241369a889cSKazutaka YOKOTA.El 242369a889cSKazutaka YOKOTA.Pp 243369a889cSKazutaka YOKOTAThe array 24466b23135SUlrich Spörlein.Va syncmask 245369a889cSKazutaka YOKOTAholds a bit mask and pattern to detect the first byte of the 246369a889cSKazutaka YOKOTAdata packet. 24766b23135SUlrich Spörlein.Va syncmask[0] 2486d249eeeSSheldon Hearnis the bit mask to be ANDed with a byte. 2496d249eeeSSheldon HearnIf the result is equal to 25066b23135SUlrich Spörlein.Va syncmask[1] , 251369a889cSKazutaka YOKOTAthe byte is likely to be the first byte of the data packet. 2527f9d55b4STim VanderhoekNote that this method of detecting the first byte is not 100% reliable; 2537f9d55b4STim Vanderhoekthus, it should be taken only as an advisory measure. 254369a889cSKazutaka YOKOTA.Pp 255369a889cSKazutaka YOKOTA.It Dv MOUSE_SETMODE Ar mousemode_t *mode 256369a889cSKazutaka YOKOTAThe command changes the current operation parameters of the mouse driver 257369a889cSKazutaka YOKOTAas specified in 258369a889cSKazutaka YOKOTA.Ar mode . 259369a889cSKazutaka YOKOTAOnly 26066b23135SUlrich Spörlein.Va level 2616d249eeeSSheldon Hearnmay be modifiable. 2626d249eeeSSheldon HearnSetting values in the other field does not generate 263369a889cSKazutaka YOKOTAerror and has no effect. 264369a889cSKazutaka YOKOTA.Pp 265369a889cSKazutaka YOKOTA.It Dv MOUSE_READDATA Ar mousedata_t *data 266369a889cSKazutaka YOKOTA.It Dv MOUSE_READSTATE Ar mousedata_t *state 267369a889cSKazutaka YOKOTAThese commands are not supported by the 268369a889cSKazutaka YOKOTA.Nm 269369a889cSKazutaka YOKOTAdriver. 270369a889cSKazutaka YOKOTA.Pp 27133099659SKazutaka YOKOTA.It Dv MOUSE_GETSTATUS Ar mousestatus_t *status 272369a889cSKazutaka YOKOTAThe command returns the current state of buttons and 273369a889cSKazutaka YOKOTAmovement counts in the structure as defined in 274369a889cSKazutaka YOKOTA.Xr mouse 4 . 275369a889cSKazutaka YOKOTA.El 276369a889cSKazutaka YOKOTA.Ss Console and Consolectl Ioctls 277369a889cSKazutaka YOKOTAThe user process issues console 278e4343c4eSMike Pritchard.Fn ioctl 279369a889cSKazutaka YOKOTAcalls to the current virtual console in order to control 280369a889cSKazutaka YOKOTAthe mouse pointer. 281369a889cSKazutaka YOKOTAThe console 282e4343c4eSMike Pritchard.Fn ioctl 283369a889cSKazutaka YOKOTAalso provides a method for the user process to receive a 284e4343c4eSMike Pritchard.Xr signal 3 285e4343c4eSMike Pritchardwhen a button is pressed. 286e4343c4eSMike Pritchard.Pp 287369a889cSKazutaka YOKOTAThe mouse daemon 288e4343c4eSMike Pritchard.Xr moused 8 289369a889cSKazutaka YOKOTAuses 290e4343c4eSMike Pritchard.Fn ioctl 291369a889cSKazutaka YOKOTAcalls to the console control device 292369a889cSKazutaka YOKOTA.Pa /dev/consolectl 293369a889cSKazutaka YOKOTAto inform the console of mouse actions including mouse movement 294369a889cSKazutaka YOKOTAand button status. 295e4343c4eSMike Pritchard.Pp 2967f9d55b4STim VanderhoekBoth classes of 297369a889cSKazutaka YOKOTA.Fn ioctl 298369a889cSKazutaka YOKOTAcommands are defined as 299369a889cSKazutaka YOKOTA.Dv CONS_MOUSECTL 300369a889cSKazutaka YOKOTAwhich takes the following argument. 301369a889cSKazutaka YOKOTA.Bd -literal 302e4343c4eSMike Pritchardstruct mouse_info { 303e4343c4eSMike Pritchard int operation; 304e4343c4eSMike Pritchard union { 305e4343c4eSMike Pritchard struct mouse_data data; 306e4343c4eSMike Pritchard struct mouse_mode mode; 307369a889cSKazutaka YOKOTA struct mouse_event event; 308e4343c4eSMike Pritchard } u; 309e4343c4eSMike Pritchard}; 310e4343c4eSMike Pritchard.Ed 311369a889cSKazutaka YOKOTA.Pp 312369a889cSKazutaka YOKOTA.Bl -tag -width operation -compact 31366b23135SUlrich Spörlein.It Va operation 314e4343c4eSMike PritchardThis can be one of 315369a889cSKazutaka YOKOTA.Pp 316369a889cSKazutaka YOKOTA.Bl -tag -width MOUSE_MOVEABS -compact 317e4343c4eSMike Pritchard.It Dv MOUSE_SHOW 318e4343c4eSMike PritchardEnables and displays mouse cursor. 319e4343c4eSMike Pritchard.It Dv MOUSE_HIDE 320e4343c4eSMike PritchardDisables and hides mouse cursor. 321e4343c4eSMike Pritchard.It Dv MOUSE_MOVEABS 322e4343c4eSMike PritchardMoves mouse cursor to position supplied in 32366b23135SUlrich Spörlein.Va u.data . 324e4343c4eSMike Pritchard.It Dv MOUSE_MOVEREL 325369a889cSKazutaka YOKOTAAdds position supplied in 32666b23135SUlrich Spörlein.Va u.data 327e4343c4eSMike Pritchardto current position. 328e4343c4eSMike Pritchard.It Dv MOUSE_GETINFO 329369a889cSKazutaka YOKOTAReturns current mouse position in the current virtual console 330369a889cSKazutaka YOKOTAand button status in 33166b23135SUlrich Spörlein.Va u.data . 332e4343c4eSMike Pritchard.It Dv MOUSE_MODE 333e4343c4eSMike PritchardThis sets the 334e4343c4eSMike Pritchard.Xr signal 3 335e4343c4eSMike Pritchardto be delivered to the current process when a button is pressed. 336e4343c4eSMike PritchardThe signal to be delivered is set in 33766b23135SUlrich Spörlein.Va u.mode . 338e4343c4eSMike Pritchard.El 339369a889cSKazutaka YOKOTA.Pp 3406d249eeeSSheldon HearnThe above operations are for virtual consoles. 3416d249eeeSSheldon HearnThe operations defined 3427f9d55b4STim Vanderhoekbelow are for the console control device and are used by 343369a889cSKazutaka YOKOTA.Xr moused 8 344369a889cSKazutaka YOKOTAto pass mouse data to the console driver. 345369a889cSKazutaka YOKOTA.Pp 346369a889cSKazutaka YOKOTA.Bl -tag -width MOUSE_MOVEABS -compact 347369a889cSKazutaka YOKOTA.It Dv MOUSE_ACTION 34806a9897cSMarkus Brueffer.It Dv MOUSE_MOTION_EVENT 349369a889cSKazutaka YOKOTAThese operations take the information in 35066b23135SUlrich Spörlein.Va u.data 351b5e7e999SRuslan Ermilovand act upon it. 352b5e7e999SRuslan ErmilovMouse data will be sent to the 353369a889cSKazutaka YOKOTA.Nm 354369a889cSKazutaka YOKOTAdriver if it is open. 355369a889cSKazutaka YOKOTA.Dv MOUSE_ACTION 356369a889cSKazutaka YOKOTAalso processes button press actions and sends signal to the process if 357369a889cSKazutaka YOKOTArequested or performs cut and paste operations 358369a889cSKazutaka YOKOTAif the current console is a text interface. 35906a9897cSMarkus Brueffer.It Dv MOUSE_BUTTON_EVENT 36066b23135SUlrich Spörlein.Va u.data 3616d249eeeSSheldon Hearnspecifies a button and its click count. 3626d249eeeSSheldon HearnThe console driver will 363369a889cSKazutaka YOKOTAuse this information for signal delivery if requested or 364369a889cSKazutaka YOKOTAfor cut and paste operations if the console is in text mode. 365369a889cSKazutaka YOKOTA.El 366369a889cSKazutaka YOKOTA.Pp 36706a9897cSMarkus Brueffer.Dv MOUSE_MOTION_EVENT 368369a889cSKazutaka YOKOTAand 36906a9897cSMarkus Brueffer.Dv MOUSE_BUTTON_EVENT 370369a889cSKazutaka YOKOTAare newer interface and are designed to be used together. 371369a889cSKazutaka YOKOTAThey are intended to replace functions performed by 372369a889cSKazutaka YOKOTA.Dv MOUSE_ACTION 373369a889cSKazutaka YOKOTAalone. 374369a889cSKazutaka YOKOTA.Pp 37566b23135SUlrich Spörlein.It Va u 376e4343c4eSMike PritchardThis union is one of 377369a889cSKazutaka YOKOTA.Pp 378369a889cSKazutaka YOKOTA.Bl -tag -width data -compact 37966b23135SUlrich Spörlein.It Va data 380369a889cSKazutaka YOKOTA.Bd -literal 381e4343c4eSMike Pritchardstruct mouse_data { 382e4343c4eSMike Pritchard int x; 383e4343c4eSMike Pritchard int y; 384369a889cSKazutaka YOKOTA int z; 385e4343c4eSMike Pritchard int buttons; 386e4343c4eSMike Pritchard}; 387e4343c4eSMike Pritchard.Ed 388369a889cSKazutaka YOKOTA.Pp 38966b23135SUlrich Spörlein.Va x , y 390369a889cSKazutaka YOKOTAand 39166b23135SUlrich Spörlein.Va z 392369a889cSKazutaka YOKOTArepresent movement of the mouse along respective directions. 39366b23135SUlrich Spörlein.Va buttons 3946d249eeeSSheldon Hearntells the state of buttons. 3956d249eeeSSheldon HearnIt encodes up to 31 buttons in the bit 0 though 396b5e7e999SRuslan Ermilovthe bit 30. 397b5e7e999SRuslan ErmilovIf a button is held down, the corresponding bit is set. 398369a889cSKazutaka YOKOTA.Pp 39966b23135SUlrich Spörlein.It Va mode 400369a889cSKazutaka YOKOTA.Bd -literal 401e4343c4eSMike Pritchardstruct mouse_mode { 402e4343c4eSMike Pritchard int mode; 403e4343c4eSMike Pritchard int signal; 404e4343c4eSMike Pritchard}; 405e4343c4eSMike Pritchard.Ed 406369a889cSKazutaka YOKOTA.Pp 407369a889cSKazutaka YOKOTAThe 40866b23135SUlrich Spörlein.Va signal 4096d249eeeSSheldon Hearnfield specifies the signal to be delivered to the process. 4106d249eeeSSheldon HearnIt must be 411369a889cSKazutaka YOKOTAone of the values defined in 412743d5d51SRuslan Ermilov.In signal.h . 413369a889cSKazutaka YOKOTAThe 41466b23135SUlrich Spörlein.Va mode 415369a889cSKazutaka YOKOTAfield is currently unused. 416369a889cSKazutaka YOKOTA.Pp 41766b23135SUlrich Spörlein.It Va event 418369a889cSKazutaka YOKOTA.Bd -literal 419369a889cSKazutaka YOKOTAstruct mouse_event { 420369a889cSKazutaka YOKOTA int id; 421369a889cSKazutaka YOKOTA int value; 422369a889cSKazutaka YOKOTA}; 423369a889cSKazutaka YOKOTA.Ed 424369a889cSKazutaka YOKOTA.Pp 425369a889cSKazutaka YOKOTAThe 42666b23135SUlrich Spörlein.Va id 427369a889cSKazutaka YOKOTAfield specifies a button number as in 42866b23135SUlrich Spörlein.Va u.data.buttons . 429369a889cSKazutaka YOKOTAOnly one bit/button is set. 430369a889cSKazutaka YOKOTAThe 43166b23135SUlrich Spörlein.Va value 432369a889cSKazutaka YOKOTAfield 433369a889cSKazutaka YOKOTAholds the click count: the number of times the user has clicked the button 434369a889cSKazutaka YOKOTAsuccessively. 435e4343c4eSMike Pritchard.El 436e4343c4eSMike Pritchard.El 437e4343c4eSMike Pritchard.Sh FILES 438e4343c4eSMike Pritchard.Bl -tag -width /dev/consolectl -compact 439e4343c4eSMike Pritchard.It Pa /dev/consolectl 440e4343c4eSMike Pritcharddevice to control the console 441e4343c4eSMike Pritchard.It Pa /dev/sysmouse 442369a889cSKazutaka YOKOTAvirtualized mouse driver 443369a889cSKazutaka YOKOTA.It Pa /dev/ttyv%d 444369a889cSKazutaka YOKOTAvirtual consoles 445e4343c4eSMike Pritchard.El 446e4343c4eSMike Pritchard.Sh SEE ALSO 447e4343c4eSMike Pritchard.Xr vidcontrol 1 , 448369a889cSKazutaka YOKOTA.Xr ioctl 2 , 449e4343c4eSMike Pritchard.Xr signal 3 , 450369a889cSKazutaka YOKOTA.Xr mouse 4 , 451e4343c4eSMike Pritchard.Xr moused 8 452e4343c4eSMike Pritchard.Sh HISTORY 453e4343c4eSMike PritchardThe 454e4343c4eSMike Pritchard.Nm 45586c18b36SGavin Atkinsondriver first appeared in 4562c8478e1SJohn-Mark Gurney.Fx 2.2 . 457aaf1f16eSPhilippe Charnier.Sh AUTHORS 458f4d874a1SRuslan Ermilov.An -nosplit 459e4343c4eSMike PritchardThis 460369a889cSKazutaka YOKOTAmanual page was written by 461*6c899950SBaptiste Daroussin.An John-Mark Gurney Aq Mt jmg@FreeBSD.org 462369a889cSKazutaka YOKOTAand 463*6c899950SBaptiste Daroussin.An Kazutaka Yokota Aq Mt yokota@FreeBSD.org . 464