12606Sdfr/*- 22606Sdfr * Copyright (c) 1992, 1993 Erik Forsberg. 331603Syokota * Copyright (c) 1996, 1997 Kazutaka YOKOTA 42606Sdfr * All rights reserved. 52606Sdfr * 62606Sdfr * Redistribution and use in source and binary forms, with or without 72606Sdfr * modification, are permitted provided that the following conditions 82606Sdfr * are met: 92606Sdfr * 1. Redistributions of source code must retain the above copyright 102606Sdfr * notice, this list of conditions and the following disclaimer. 112606Sdfr * 122606Sdfr * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED 132606Sdfr * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 142606Sdfr * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 152606Sdfr * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 162606Sdfr * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 172606Sdfr * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 182606Sdfr * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 192606Sdfr * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 202606Sdfr * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 212606Sdfr * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 222606Sdfr * 2350477Speter * $FreeBSD: stable/11/sys/sys/mouse.h 344165 2019-02-15 20:46:03Z wulf $ 242606Sdfr */ 252606Sdfr 2666860Sphk#ifndef _SYS_MOUSE_H_ 2766860Sphk#define _SYS_MOUSE_H_ 2819753Ssos 2919753Ssos#include <sys/types.h> 3019753Ssos#include <sys/ioccom.h> 3119753Ssos 3231603Syokota/* ioctls */ 3331603Syokota#define MOUSE_GETSTATUS _IOR('M', 0, mousestatus_t) 3431603Syokota#define MOUSE_GETHWINFO _IOR('M', 1, mousehw_t) 3531603Syokota#define MOUSE_GETMODE _IOR('M', 2, mousemode_t) 3631603Syokota#define MOUSE_SETMODE _IOW('M', 3, mousemode_t) 3731603Syokota#define MOUSE_GETLEVEL _IOR('M', 4, int) 3831603Syokota#define MOUSE_SETLEVEL _IOW('M', 5, int) 3931603Syokota#define MOUSE_GETVARS _IOR('M', 6, mousevar_t) 4031603Syokota#define MOUSE_SETVARS _IOW('M', 7, mousevar_t) 4131603Syokota#define MOUSE_READSTATE _IOWR('M', 8, mousedata_t) 4231603Syokota#define MOUSE_READDATA _IOWR('M', 9, mousedata_t) 4319753Ssos 44153072Sru#ifdef notyet 4531603Syokota#define MOUSE_SETRESOLUTION _IOW('M', 10, int) 4631603Syokota#define MOUSE_SETSCALING _IOW('M', 11, int) 4731603Syokota#define MOUSE_SETRATE _IOW('M', 12, int) 4831603Syokota#define MOUSE_GETHWID _IOR('M', 13, int) 4931603Syokota#endif 5019753Ssos 51132865Snjl#define MOUSE_SYN_GETHWINFO _IOR('M', 100, synapticshw_t) 52132865Snjl 5320073Ssos/* mouse status block */ 5420073Ssostypedef struct mousestatus { 5531603Syokota int flags; /* state change flags */ 5620073Ssos int button; /* button status */ 5720073Ssos int obutton; /* previous button status */ 5820073Ssos int dx; /* x movement */ 5920073Ssos int dy; /* y movement */ 6031603Syokota int dz; /* z movement */ 6120073Ssos} mousestatus_t; 6221327Snate 6320073Ssos/* button */ 6420073Ssos#define MOUSE_BUTTON1DOWN 0x0001 /* left */ 6520073Ssos#define MOUSE_BUTTON2DOWN 0x0002 /* middle */ 6620073Ssos#define MOUSE_BUTTON3DOWN 0x0004 /* right */ 6720073Ssos#define MOUSE_BUTTON4DOWN 0x0008 6820073Ssos#define MOUSE_BUTTON5DOWN 0x0010 6920073Ssos#define MOUSE_BUTTON6DOWN 0x0020 7020073Ssos#define MOUSE_BUTTON7DOWN 0x0040 7120073Ssos#define MOUSE_BUTTON8DOWN 0x0080 7231603Syokota#define MOUSE_MAXBUTTON 31 7331603Syokota#define MOUSE_STDBUTTONS 0x0007 /* buttons 1-3 */ 7431603Syokota#define MOUSE_EXTBUTTONS 0x7ffffff8 /* the others (28 of them!) */ 7531603Syokota#define MOUSE_BUTTONS (MOUSE_STDBUTTONS | MOUSE_EXTBUTTONS) 7620073Ssos 7731603Syokota/* flags */ 7831603Syokota#define MOUSE_STDBUTTONSCHANGED MOUSE_STDBUTTONS 7931603Syokota#define MOUSE_EXTBUTTONSCHANGED MOUSE_EXTBUTTONS 8031603Syokota#define MOUSE_BUTTONSCHANGED MOUSE_BUTTONS 8131603Syokota#define MOUSE_POSCHANGED 0x80000000 8231603Syokota 8319753Ssostypedef struct mousehw { 8431603Syokota int buttons; /* -1 if unknown */ 8519753Ssos int iftype; /* MOUSE_IF_XXX */ 8619753Ssos int type; /* mouse/track ball/pad... */ 8731603Syokota int model; /* I/F dependent model ID: MOUSE_MODEL_XXX */ 8819753Ssos int hwid; /* I/F dependent hardware ID 89281440Srpaulo * for the PS/2 mouse, it will be PSM_XXX_ID 9021327Snate */ 9119753Ssos} mousehw_t; 9221327Snate 93132865Snjltypedef struct synapticshw { 94132865Snjl int infoMajor; 95132865Snjl int infoMinor; 96132865Snjl int infoRot180; 97132865Snjl int infoPortrait; 98132865Snjl int infoSensor; 99132865Snjl int infoHardware; 100132865Snjl int infoNewAbs; 101132865Snjl int capPen; 102132865Snjl int infoSimplC; 103132865Snjl int infoGeometry; 104132865Snjl int capExtended; 105132865Snjl int capSleep; 106132865Snjl int capFourButtons; 107132865Snjl int capMultiFinger; 108132865Snjl int capPalmDetect; 109255154Sdumbbell int capPassthrough; 110255154Sdumbbell int capMiddle; 111281127Srpaulo int capLowPower; 112281127Srpaulo int capMultiFingerReport; 113281127Srpaulo int capBallistics; 114255154Sdumbbell int nExtendedButtons; 115255154Sdumbbell int nExtendedQueries; 116281440Srpaulo int capClickPad; 117281440Srpaulo int capDeluxeLEDs; 118281440Srpaulo int noAbsoluteFilter; 119281440Srpaulo int capReportsV; 120281440Srpaulo int capUniformClickPad; 121281440Srpaulo int capReportsMin; 122281440Srpaulo int capInterTouch; 123281440Srpaulo int capReportsMax; 124281440Srpaulo int capClearPad; 125281440Srpaulo int capAdvancedGestures; 126281440Srpaulo int multiFingerMode; 127281440Srpaulo int capCoveredPad; 128281440Srpaulo int verticalScroll; 129281440Srpaulo int horizontalScroll; 130281440Srpaulo int verticalWheel; 131282734Srpaulo int capEWmode; 132282734Srpaulo int minimumXCoord; 133282734Srpaulo int minimumYCoord; 134282734Srpaulo int maximumXCoord; 135282734Srpaulo int maximumYCoord; 136282734Srpaulo int infoXupmm; 137282734Srpaulo int infoYupmm; 138331170Seadler int forcePad; 139344165Swulf int topButtonPad; 140132865Snjl} synapticshw_t; 141132865Snjl 14219753Ssos/* iftype */ 14331603Syokota#define MOUSE_IF_UNKNOWN (-1) 14419753Ssos#define MOUSE_IF_SERIAL 0 14519753Ssos#define MOUSE_IF_BUS 1 14619753Ssos#define MOUSE_IF_INPORT 2 14719753Ssos#define MOUSE_IF_PS2 3 14831603Syokota#define MOUSE_IF_SYSMOUSE 4 14944186Sn_hibma#define MOUSE_IF_USB 5 15021327Snate 15119753Ssos/* type */ 15219753Ssos#define MOUSE_UNKNOWN (-1) /* should be treated as a mouse */ 15319753Ssos#define MOUSE_MOUSE 0 15419753Ssos#define MOUSE_TRACKBALL 1 15519753Ssos#define MOUSE_STICK 2 15619753Ssos#define MOUSE_PAD 3 1572606Sdfr 15831603Syokota/* model */ 15931603Syokota#define MOUSE_MODEL_UNKNOWN (-1) 16031603Syokota#define MOUSE_MODEL_GENERIC 0 16131603Syokota#define MOUSE_MODEL_GLIDEPOINT 1 16231603Syokota#define MOUSE_MODEL_NETSCROLL 2 16331603Syokota#define MOUSE_MODEL_NET 3 16431603Syokota#define MOUSE_MODEL_INTELLI 4 16531603Syokota#define MOUSE_MODEL_THINK 5 16631603Syokota#define MOUSE_MODEL_EASYSCROLL 6 16731603Syokota#define MOUSE_MODEL_MOUSEMANPLUS 7 16841271Syokota#define MOUSE_MODEL_KIDSPAD 8 16949964Syokota#define MOUSE_MODEL_VERSAPAD 9 17058230Syokota#define MOUSE_MODEL_EXPLORER 10 17158230Syokota#define MOUSE_MODEL_4D 11 17258230Syokota#define MOUSE_MODEL_4DPLUS 12 173132865Snjl#define MOUSE_MODEL_SYNAPTICS 13 174248478Sjkim#define MOUSE_MODEL_TRACKPOINT 14 175307576Sgonzo#define MOUSE_MODEL_ELANTECH 15 17631603Syokota 17719753Ssostypedef struct mousemode { 17819753Ssos int protocol; /* MOUSE_PROTO_XXX */ 17919753Ssos int rate; /* report rate (per sec), -1 if unknown */ 18031603Syokota int resolution; /* MOUSE_RES_XXX, -1 if unknown */ 18119753Ssos int accelfactor; /* accelation factor (must be 1 or greater) */ 18231603Syokota int level; /* driver operation level */ 18331603Syokota int packetsize; /* the length of the data packet */ 18431603Syokota unsigned char syncmask[2]; /* sync. data bits in the header byte */ 18519753Ssos} mousemode_t; 18621327Snate 18719753Ssos/* protocol */ 18858230Syokota/* 18958230Syokota * Serial protocols: 19058230Syokota * Microsoft, MouseSystems, Logitech, MM series, MouseMan, Hitachi Tablet, 19158230Syokota * GlidePoint, IntelliMouse, Thinking Mouse, MouseRemote, Kidspad, 19258230Syokota * VersaPad 19358230Syokota * Bus mouse protocols: 19458230Syokota * bus, InPort 19558230Syokota * PS/2 mouse protocol: 19658230Syokota * PS/2 19758230Syokota */ 19831603Syokota#define MOUSE_PROTO_UNKNOWN (-1) 19919753Ssos#define MOUSE_PROTO_MS 0 /* Microsoft Serial, 3 bytes */ 20019753Ssos#define MOUSE_PROTO_MSC 1 /* Mouse Systems, 5 bytes */ 20119753Ssos#define MOUSE_PROTO_LOGI 2 /* Logitech, 3 bytes */ 20219753Ssos#define MOUSE_PROTO_MM 3 /* MM series, 3 bytes */ 20319753Ssos#define MOUSE_PROTO_LOGIMOUSEMAN 4 /* Logitech MouseMan 3/4 bytes */ 20419753Ssos#define MOUSE_PROTO_BUS 5 /* MS/Logitech bus mouse */ 20531603Syokota#define MOUSE_PROTO_INPORT 6 /* MS/ATI InPort mouse */ 20619753Ssos#define MOUSE_PROTO_PS2 7 /* PS/2 mouse, 3 bytes */ 20731603Syokota#define MOUSE_PROTO_HITTAB 8 /* Hitachi Tablet 3 bytes */ 20831603Syokota#define MOUSE_PROTO_GLIDEPOINT 9 /* ALPS GlidePoint, 3/4 bytes */ 20931603Syokota#define MOUSE_PROTO_INTELLI 10 /* MS IntelliMouse, 4 bytes */ 210165335Skeramida#define MOUSE_PROTO_THINK 11 /* Kensington Thinking Mouse, 3/4 bytes */ 21131603Syokota#define MOUSE_PROTO_SYSMOUSE 12 /* /dev/sysmouse */ 21236991Sahasty#define MOUSE_PROTO_X10MOUSEREM 13 /* X10 MouseRemote, 3 bytes */ 21341271Syokota#define MOUSE_PROTO_KIDSPAD 14 /* Genius Kidspad */ 21449964Syokota#define MOUSE_PROTO_VERSAPAD 15 /* Interlink VersaPad, 6 bytes */ 21593071Swill#define MOUSE_PROTO_JOGDIAL 16 /* Vaio's JogDial */ 216145001Smdodd#define MOUSE_PROTO_GTCO_DIGIPAD 17 21719753Ssos 21831603Syokota#define MOUSE_RES_UNKNOWN (-1) 21931603Syokota#define MOUSE_RES_DEFAULT 0 22031603Syokota#define MOUSE_RES_LOW (-2) 22131603Syokota#define MOUSE_RES_MEDIUMLOW (-3) 22231603Syokota#define MOUSE_RES_MEDIUMHIGH (-4) 22331603Syokota#define MOUSE_RES_HIGH (-5) 22431603Syokota 22531603Syokotatypedef struct mousedata { 22631603Syokota int len; /* # of data in the buffer */ 22731603Syokota int buf[16]; /* data buffer */ 22831603Syokota} mousedata_t; 22931603Syokota 23031603Syokota#if (defined(MOUSE_GETVARS)) 23131603Syokota 23231603Syokotatypedef struct mousevar { 23331603Syokota int var[16]; 23431603Syokota} mousevar_t; 23531603Syokota 23631603Syokota/* magic numbers in var[0] */ 23731603Syokota#define MOUSE_VARS_PS2_SIG 0x00325350 /* 'PS2' */ 23831603Syokota#define MOUSE_VARS_BUS_SIG 0x00535542 /* 'BUS' */ 23931603Syokota#define MOUSE_VARS_INPORT_SIG 0x00504e49 /* 'INP' */ 24031603Syokota 24131603Syokota#endif /* MOUSE_GETVARS */ 24231603Syokota 243132865Snjl/* Synaptics Touchpad */ 244132865Snjl#define MOUSE_SYNAPTICS_PACKETSIZE 6 /* '3' works better */ 245132865Snjl 246307576Sgonzo/* Elantech Touchpad */ 247307576Sgonzo#define MOUSE_ELANTECH_PACKETSIZE 6 248307576Sgonzo 24919753Ssos/* Microsoft Serial mouse data packet */ 25019753Ssos#define MOUSE_MSS_PACKETSIZE 3 25119753Ssos#define MOUSE_MSS_SYNCMASK 0x40 25219753Ssos#define MOUSE_MSS_SYNC 0x40 25319753Ssos#define MOUSE_MSS_BUTTONS 0x30 25419753Ssos#define MOUSE_MSS_BUTTON1DOWN 0x20 /* left */ 25519753Ssos#define MOUSE_MSS_BUTTON2DOWN 0x00 /* no middle button */ 25619753Ssos#define MOUSE_MSS_BUTTON3DOWN 0x10 /* right */ 25719753Ssos 25820073Ssos/* Logitech MouseMan data packet (M+ protocol) */ 25931603Syokota#define MOUSE_LMAN_BUTTON2DOWN 0x20 /* middle button, the 4th byte */ 26020073Ssos 26179298Sdd/* ALPS GlidePoint extension (variant of M+ protocol) */ 26231603Syokota#define MOUSE_ALPS_BUTTON2DOWN 0x20 /* middle button, the 4th byte */ 26331603Syokota#define MOUSE_ALPS_TAP 0x10 /* `tapping' action, the 4th byte */ 26431603Syokota 26579298Sdd/* Kinsington Thinking Mouse extension (variant of M+ protocol) */ 26631603Syokota#define MOUSE_THINK_BUTTON2DOWN 0x20 /* lower-left button, the 4th byte */ 26731603Syokota#define MOUSE_THINK_BUTTON4DOWN 0x10 /* lower-right button, the 4th byte */ 26831603Syokota 26931603Syokota/* MS IntelliMouse (variant of MS Serial) */ 27031603Syokota#define MOUSE_INTELLI_PACKETSIZE 4 27158230Syokota#define MOUSE_INTELLI_BUTTON2DOWN 0x10 /* middle button in the 4th byte */ 27231603Syokota 27319753Ssos/* Mouse Systems Corp. mouse data packet */ 27419753Ssos#define MOUSE_MSC_PACKETSIZE 5 27519753Ssos#define MOUSE_MSC_SYNCMASK 0xf8 27619753Ssos#define MOUSE_MSC_SYNC 0x80 27719753Ssos#define MOUSE_MSC_BUTTONS 0x07 27819753Ssos#define MOUSE_MSC_BUTTON1UP 0x04 /* left */ 27919753Ssos#define MOUSE_MSC_BUTTON2UP 0x02 /* middle */ 28019753Ssos#define MOUSE_MSC_BUTTON3UP 0x01 /* right */ 28144186Sn_hibma#define MOUSE_MSC_MAXBUTTON 3 28219753Ssos 28320073Ssos/* MM series mouse data packet */ 28420073Ssos#define MOUSE_MM_PACKETSIZE 3 28520073Ssos#define MOUSE_MM_SYNCMASK 0xe0 28620073Ssos#define MOUSE_MM_SYNC 0x80 28720073Ssos#define MOUSE_MM_BUTTONS 0x07 28820073Ssos#define MOUSE_MM_BUTTON1DOWN 0x04 /* left */ 28920073Ssos#define MOUSE_MM_BUTTON2DOWN 0x02 /* middle */ 29020073Ssos#define MOUSE_MM_BUTTON3DOWN 0x01 /* right */ 29120073Ssos#define MOUSE_MM_XPOSITIVE 0x10 29220073Ssos#define MOUSE_MM_YPOSITIVE 0x08 29320073Ssos 29419753Ssos/* PS/2 mouse data packet */ 29519753Ssos#define MOUSE_PS2_PACKETSIZE 3 29631603Syokota#define MOUSE_PS2_SYNCMASK 0xc8 29731603Syokota#define MOUSE_PS2_SYNC 0x08 29819753Ssos#define MOUSE_PS2_BUTTONS 0x07 /* 0x03 for 2 button mouse */ 29919753Ssos#define MOUSE_PS2_BUTTON1DOWN 0x01 /* left */ 30019753Ssos#define MOUSE_PS2_BUTTON2DOWN 0x04 /* middle */ 30119753Ssos#define MOUSE_PS2_BUTTON3DOWN 0x02 /* right */ 30231603Syokota#define MOUSE_PS2_TAP MOUSE_PS2_SYNC /* GlidePoint (PS/2) `tapping' 303281440Srpaulo * Yes! this is the same bit 30431603Syokota * as SYNC! 30531603Syokota */ 30631603Syokota 30719753Ssos#define MOUSE_PS2_XNEG 0x10 30819753Ssos#define MOUSE_PS2_YNEG 0x20 30919753Ssos#define MOUSE_PS2_XOVERFLOW 0x40 31019753Ssos#define MOUSE_PS2_YOVERFLOW 0x80 31158230Syokota 31258230Syokota/* Logitech MouseMan+ (PS/2) data packet (PS/2++ protocol) */ 31348778Syokota#define MOUSE_PS2PLUS_SYNCMASK 0x48 31448778Syokota#define MOUSE_PS2PLUS_SYNC 0x48 31558230Syokota#define MOUSE_PS2PLUS_ZNEG 0x08 /* sign bit */ 31658230Syokota#define MOUSE_PS2PLUS_BUTTON4DOWN 0x10 /* 4th button on MouseMan+ */ 31758230Syokota#define MOUSE_PS2PLUS_BUTTON5DOWN 0x20 31819753Ssos 31958230Syokota/* IBM ScrollPoint (PS/2) also uses PS/2++ protocol */ 32058230Syokota#define MOUSE_SPOINT_ZNEG 0x80 /* sign bits */ 32158230Syokota#define MOUSE_SPOINT_WNEG 0x08 32258230Syokota 32358230Syokota/* MS IntelliMouse (PS/2) data packet */ 32458230Syokota#define MOUSE_PS2INTELLI_PACKETSIZE 4 32558230Syokota/* some compatible mice have additional buttons */ 32658230Syokota#define MOUSE_PS2INTELLI_BUTTON4DOWN 0x40 32758230Syokota#define MOUSE_PS2INTELLI_BUTTON5DOWN 0x80 32858230Syokota 32958230Syokota/* MS IntelliMouse Explorer (PS/2) data packet (variation of IntelliMouse) */ 33058230Syokota#define MOUSE_EXPLORER_ZNEG 0x08 /* sign bit */ 33158230Syokota/* IntelliMouse Explorer has additional button data in the fourth byte */ 33258230Syokota#define MOUSE_EXPLORER_BUTTON4DOWN 0x10 33358230Syokota#define MOUSE_EXPLORER_BUTTON5DOWN 0x20 33458230Syokota 33549964Syokota/* Interlink VersaPad (serial I/F) data packet */ 33649964Syokota#define MOUSE_VERSA_PACKETSIZE 6 33749964Syokota#define MOUSE_VERSA_IN_USE 0x04 33849964Syokota#define MOUSE_VERSA_SYNCMASK 0xc3 33949964Syokota#define MOUSE_VERSA_SYNC 0xc0 34049964Syokota#define MOUSE_VERSA_BUTTONS 0x30 34149964Syokota#define MOUSE_VERSA_BUTTON1DOWN 0x20 /* left */ 34249964Syokota#define MOUSE_VERSA_BUTTON2DOWN 0x00 /* middle */ 34349964Syokota#define MOUSE_VERSA_BUTTON3DOWN 0x10 /* right */ 34449964Syokota#define MOUSE_VERSA_TAP 0x08 34549964Syokota 34649964Syokota/* Interlink VersaPad (PS/2 I/F) data packet */ 34749964Syokota#define MOUSE_PS2VERSA_PACKETSIZE 6 34849964Syokota#define MOUSE_PS2VERSA_IN_USE 0x10 34949964Syokota#define MOUSE_PS2VERSA_SYNCMASK 0xe8 35049964Syokota#define MOUSE_PS2VERSA_SYNC 0xc8 35149964Syokota#define MOUSE_PS2VERSA_BUTTONS 0x05 35249964Syokota#define MOUSE_PS2VERSA_BUTTON1DOWN 0x04 /* left */ 35349964Syokota#define MOUSE_PS2VERSA_BUTTON2DOWN 0x00 /* middle */ 35449964Syokota#define MOUSE_PS2VERSA_BUTTON3DOWN 0x01 /* right */ 35549964Syokota#define MOUSE_PS2VERSA_TAP 0x02 35649964Syokota 35758230Syokota/* A4 Tech 4D Mouse (PS/2) data packet */ 358281440Srpaulo#define MOUSE_4D_PACKETSIZE 3 35958230Syokota#define MOUSE_4D_WHEELBITS 0xf0 36058230Syokota 36158230Syokota/* A4 Tech 4D+ Mouse (PS/2) data packet */ 362281440Srpaulo#define MOUSE_4DPLUS_PACKETSIZE 3 36358230Syokota#define MOUSE_4DPLUS_ZNEG 0x04 /* sign bit */ 36458230Syokota#define MOUSE_4DPLUS_BUTTON4DOWN 0x08 36558230Syokota 36631603Syokota/* sysmouse extended data packet */ 36731603Syokota/* 36831603Syokota * /dev/sysmouse sends data in two formats, depending on the protocol 36931603Syokota * level. At the level 0, format is exactly the same as MousSystems' 37031603Syokota * five byte packet. At the level 1, the first five bytes are the same 37131603Syokota * as at the level 0. There are additional three bytes which shows 37231603Syokota * `dz' and the states of additional buttons. `dz' is expressed as the 37331603Syokota * sum of the byte 5 and 6 which contain signed seven bit values. 374281440Srpaulo * The states of the button 4 though 10 are in the bit 0 though 6 in 37531603Syokota * the byte 7 respectively: 1 indicates the button is up. 37631603Syokota */ 37731603Syokota#define MOUSE_SYS_PACKETSIZE 8 37831603Syokota#define MOUSE_SYS_SYNCMASK 0xf8 37931603Syokota#define MOUSE_SYS_SYNC 0x80 38031603Syokota#define MOUSE_SYS_BUTTON1UP 0x04 /* left, 1st byte */ 38131603Syokota#define MOUSE_SYS_BUTTON2UP 0x02 /* middle, 1st byte */ 38231603Syokota#define MOUSE_SYS_BUTTON3UP 0x01 /* right, 1st byte */ 38331603Syokota#define MOUSE_SYS_BUTTON4UP 0x0001 /* 7th byte */ 38431603Syokota#define MOUSE_SYS_BUTTON5UP 0x0002 38531603Syokota#define MOUSE_SYS_BUTTON6UP 0x0004 38631603Syokota#define MOUSE_SYS_BUTTON7UP 0x0008 38731603Syokota#define MOUSE_SYS_BUTTON8UP 0x0010 38831603Syokota#define MOUSE_SYS_BUTTON9UP 0x0020 38931603Syokota#define MOUSE_SYS_BUTTON10UP 0x0040 39031603Syokota#define MOUSE_SYS_MAXBUTTON 10 39131603Syokota#define MOUSE_SYS_STDBUTTONS 0x07 39231603Syokota#define MOUSE_SYS_EXTBUTTONS 0x7f /* the others */ 39331603Syokota 39436991Sahasty/* Mouse remote socket */ 39536991Sahasty#define _PATH_MOUSEREMOTE "/var/run/MouseRemote" 39636991Sahasty 39766860Sphk#endif /* _SYS_MOUSE_H_ */ 398