1
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/os2_io.c,v 3.17 2003/02/17 15:11:58 dawes Exp $ */
3
* (c) Copyright 1994,1999 by Holger Veit
5
* Modified 1996 by Sebastien Marineau <marineau@genie.uottawa.ca>
7
* Permission is hereby granted, free of charge, to any person obtaining a
8
* copy of this software and associated documentation files (the "Software"),
9
* to deal in the Software without restriction, including without limitation
10
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
* and/or sell copies of the Software, and to permit persons to whom the
12
* Software is furnished to do so, subject to the following conditions:
14
* The above copyright notice and this permission notice shall be included in
15
* all copies or substantial portions of the Software.
17
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
* HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
* Except as contained in this notice, the name of Holger Veit shall not be
26
* used in advertising or otherwise to promote the sale, use or other dealings
27
* in this Software without prior written authorization from Holger Veit.
30
/* $XConsortium: os2_io.c /main/9 1996/05/13 16:38:07 kaleb $ */
38
#define INCL_DOSPROCESS
43
#include "xf86_OSlib.h"
45
int os2MouseQueueQuery();
46
int os2KbdQueueQuery();
47
void os2RecoverFromPopup();
48
void os2CheckPopupPending();
49
extern BOOL os2PopupErrorPending;
50
int _select2 (int, fd_set *, fd_set *,fd_set *, struct timeval *);
53
/***************************************************************************/
55
void xf86SoundKbdBell(loudness, pitch, duration)
60
DosBeep((ULONG)pitch, (ULONG)duration);
63
void xf86SetKbdLeds(leds)
69
rc = KbdGetStatus(&kinfo,(HKBD)xf86Info.consoleFd);
72
kinfo.fsState &= ~0x70;
73
kinfo.fsState |= (leds&0x70);
74
KbdSetStatus(&kinfo,(HKBD)xf86Info.consoleFd);
83
rc = KbdGetStatus(&kinfo,(HKBD)xf86Info.consoleFd);
84
return rc ? 0 : kinfo.fsState & 0x70;
87
#if NeedFunctionPrototypes
88
void xf86SetKbdRepeat(char rad)
90
void xf86SetKbdRepeat(rad)
104
USHORT OrigKbdInterim;
122
KbdGetStatus(&info,(HKBD)xf86Info.consoleFd);
123
OrigKbdState=info.fsMask;
124
OrigKbdInterim=info.fsInterim;
125
info.fsMask &= ~0x09;
126
info.fsMask |= 0x136;
127
info.fsInterim &= ~0x20;
128
KbdSetStatus(&info,(HKBD)xf86Info.consoleFd);
138
info.fsMask=OrigKbdState;
139
info.fsInterim=OrigKbdInterim;
140
KbdSetStatus(&info,(HKBD)xf86Info.consoleFd);
145
void xf86MouseInit(mouse)
152
if (serverGeneration == 1) {
153
rc = MouOpen((PSZ)NULL,(PHMOU)&fd);
155
FatalError("Cannot open mouse, rc=%d\n", rc);
159
/* flush mouse queue */
163
rc = MouGetNumButtons(&nbut,fd);
165
xf86Msg(X_INFO,"OsMouse has %d button(s).\n",nbut);
170
int xf86MouseOn(mouse)
179
"Calling MouseOn, a bad thing.... Must be some bug in the code!\n");
182
if (serverGeneration == 1) {
183
rc = MouOpen((PSZ)NULL,(PHMOU)&fd);
185
FatalError("Cannot open mouse, rc=%d\n", rc);
189
/* flush mouse queue */
193
rc = MouGetNumButtons(&nbut,fd);
195
xf86Msg(X_INFO,"OsMouse has %d button(s).\n",nbut);
197
return (mouse->mseFd);
203
/* This table is a bit irritating, because these mouse types are infact
204
* defined in the OS/2 kernel, but I want to force the user to put
205
* "OsMouse" in the config file, and not worry about the particular mouse
206
* type that is connected.
208
Bool xf86SupportedMouseTypes[] =
210
FALSE, /* Microsoft */
211
FALSE, /* MouseSystems */
212
FALSE, /* MMSeries */
213
FALSE, /* Logitech */
214
FALSE, /* BusMouse */
215
FALSE, /* MouseMan */
217
FALSE, /* Hitachi Tablet */
220
int xf86NumMouseTypes = sizeof(xf86SupportedMouseTypes) /
221
sizeof(xf86SupportedMouseTypes[0]);
224
#include "xf86OSKbd.h"
227
xf86OSKbdPreInit(InputInfoPtr pInfo)