3 Copyright 1993, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included
12 in all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of The Open Group shall
23 not be used in advertising or otherwise to promote the sale, use or
24 other dealings in this Software without prior written authorization
29 #ifdef HAVE_DIX_CONFIG_H
30 #include <dix-config.h>
35 #include <X11/Xproto.h>
36 #include "scrnintstr.h"
39 #include "mipointer.h"
41 #include <X11/keysym.h>
42 #include "xserver-properties.h"
47 LegalModifier(unsigned int key
, DeviceIntPtr pDev
)
53 ProcessInputEvents(void)
55 mieqProcessInputEvents();
59 DDXRingBell(int volume
, int pitch
, int duration
)
64 #define VFB_MAX_KEY 255
67 vfbKeybdProc(DeviceIntPtr pDevice
, int onoff
)
69 DevicePtr pDev
= (DevicePtr
) pDevice
;
73 InitKeyboardDeviceStruct(pDevice
, NULL
, NULL
, NULL
);
88 vfbMouseProc(DeviceIntPtr pDevice
, int onoff
)
93 BYTE map
[NBUTTONS
+ 1];
94 DevicePtr pDev
= (DevicePtr
) pDevice
;
95 Atom btn_labels
[NBUTTONS
] = { 0 };
96 Atom axes_labels
[NAXES
] = { 0 };
104 btn_labels
[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT
);
105 btn_labels
[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE
);
106 btn_labels
[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT
);
108 axes_labels
[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X
);
109 axes_labels
[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y
);
111 InitPointerDeviceStruct(pDev
, map
, NBUTTONS
, btn_labels
,
112 (PtrCtrlProcPtr
) NoopDDA
,
113 GetMotionHistorySize(), NAXES
, axes_labels
);
134 InitInput(int argc
, char *argv
[])
139 p
= AddInputDevice(serverClient
, vfbMouseProc
, TRUE
);
140 k
= AddInputDevice(serverClient
, vfbKeybdProc
, TRUE
);
141 xiclass
= MakeAtom(XI_MOUSE
, sizeof(XI_MOUSE
) - 1, TRUE
);
142 AssignTypeAndName(p
, xiclass
, "Xvfb mouse");
143 xiclass
= MakeAtom(XI_KEYBOARD
, sizeof(XI_KEYBOARD
) - 1, TRUE
);
144 AssignTypeAndName(k
, xiclass
, "Xvfb keyboard");