xorg ddx: move to new input API, remove old keyboard driver
Remove most of the rest of the old keyboard driver. Move to the new Get{Keyboard,Pointer}Events API, which is mostly complete at this stage: just missing the proximity events.
This commit is contained in:
parent
d32dc8bf19
commit
60ea7b51fe
|
@ -1136,7 +1136,6 @@ configInputKbd(IDevPtr inputp)
|
||||||
xf86Info.kbdDelay = 500;
|
xf86Info.kbdDelay = 500;
|
||||||
xf86Info.kbdRate = 30;
|
xf86Info.kbdRate = 30;
|
||||||
|
|
||||||
xf86Info.kbdProc = NULL;
|
|
||||||
xf86Info.vtinit = NULL;
|
xf86Info.vtinit = NULL;
|
||||||
xf86Info.vtSysreq = VT_SYSREQ_DEFAULT;
|
xf86Info.vtSysreq = VT_SYSREQ_DEFAULT;
|
||||||
#if defined(SVR4) && defined(i386)
|
#if defined(SVR4) && defined(i386)
|
||||||
|
@ -1172,8 +1171,6 @@ configInputKbd(IDevPtr inputp)
|
||||||
|
|
||||||
s = xf86SetStrOption(inputp->commonOptions, "Protocol", kbdproto);
|
s = xf86SetStrOption(inputp->commonOptions, "Protocol", kbdproto);
|
||||||
if (xf86NameCmp(s, "standard") == 0) {
|
if (xf86NameCmp(s, "standard") == 0) {
|
||||||
xf86Info.kbdProc = xf86KbdProc;
|
|
||||||
xf86Info.kbdEvents = xf86KbdEvents;
|
|
||||||
xfree(s);
|
xfree(s);
|
||||||
} else if (xf86NameCmp(s, "xqueue") == 0) {
|
} else if (xf86NameCmp(s, "xqueue") == 0) {
|
||||||
#ifdef __UNIXWARE__
|
#ifdef __UNIXWARE__
|
||||||
|
@ -1181,20 +1178,14 @@ configInputKbd(IDevPtr inputp)
|
||||||
* To retain compatibility with older config files, on UnixWare, we
|
* To retain compatibility with older config files, on UnixWare, we
|
||||||
* accept the xqueue protocol but use the normal keyboard procs.
|
* accept the xqueue protocol but use the normal keyboard procs.
|
||||||
*/
|
*/
|
||||||
xf86Info.kbdProc = xf86KbdProc;
|
|
||||||
xf86Info.kbdEvents = xf86KbdEvents;
|
|
||||||
#else
|
#else
|
||||||
#ifdef XQUEUE
|
#ifdef XQUEUE
|
||||||
xf86Info.kbdProc = xf86XqueKbdProc;
|
|
||||||
xf86Info.kbdEvents = xf86XqueEvents;
|
|
||||||
xf86Msg(X_CONFIG, "Xqueue selected for keyboard input\n");
|
xf86Msg(X_CONFIG, "Xqueue selected for keyboard input\n");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
xfree(s);
|
xfree(s);
|
||||||
#ifdef WSCONS_SUPPORT
|
#ifdef WSCONS_SUPPORT
|
||||||
} else if (xf86NameCmp(s, "wskbd") == 0) {
|
} else if (xf86NameCmp(s, "wskbd") == 0) {
|
||||||
xf86Info.kbdProc = xf86KbdProc;
|
|
||||||
xf86Info.kbdEvents = xf86WSKbdEvents;
|
|
||||||
xfree(s);
|
xfree(s);
|
||||||
s = xf86SetStrOption(inputp->commonOptions, "Device", NULL);
|
s = xf86SetStrOption(inputp->commonOptions, "Device", NULL);
|
||||||
xf86Msg(X_CONFIG, "Keyboard: Protocol: wskbd\n");
|
xf86Msg(X_CONFIG, "Keyboard: Protocol: wskbd\n");
|
||||||
|
|
|
@ -78,14 +78,9 @@ static miPointerScreenFuncRec xf86PointerScreenFuncs = {
|
||||||
xf86CursorOffScreen,
|
xf86CursorOffScreen,
|
||||||
xf86CrossScreen,
|
xf86CrossScreen,
|
||||||
xf86WarpCursor,
|
xf86WarpCursor,
|
||||||
#ifdef XINPUT
|
|
||||||
xf86eqEnqueue,
|
|
||||||
xf86eqSwitchScreen
|
|
||||||
#else
|
|
||||||
/* let miPointerInitialize take care of these */
|
/* let miPointerInitialize take care of these */
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS];
|
static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS];
|
||||||
|
|
|
@ -923,7 +923,7 @@ DGAStealKeyEvent(int index, xEvent *e)
|
||||||
de.u.u.type = e->u.u.type + *XDGAEventBase;
|
de.u.u.type = e->u.u.type + *XDGAEventBase;
|
||||||
de.u.u.detail = e->u.u.detail;
|
de.u.u.detail = e->u.u.detail;
|
||||||
de.u.event.time = e->u.keyButtonPointer.time;
|
de.u.event.time = e->u.keyButtonPointer.time;
|
||||||
xf86eqEnqueue ((xEvent *) &de);
|
mieqEnqueue ((xEvent *) &de);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -960,7 +960,7 @@ DGAStealMouseEvent(int index, xEvent *e, int dx, int dy)
|
||||||
de.u.event.dy = dy;
|
de.u.event.dy = dy;
|
||||||
de.u.event.pad1 = DGAMouseX;
|
de.u.event.pad1 = DGAMouseX;
|
||||||
de.u.event.pad2 = DGAMouseY;
|
de.u.event.pad2 = DGAMouseY;
|
||||||
xf86eqEnqueue ((xEvent *) &de);
|
mieqEnqueue ((xEvent *) &de);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,7 @@ void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
xf86STimestamp(xf86TsPtr* timestamp)
|
xf86STimestamp(xf86TsPtr* timestamp)
|
||||||
{
|
{
|
||||||
|
@ -195,3 +196,4 @@ xf86SPTimestamp(xf86TsPtr* timestamp, char *str)
|
||||||
gettimeofday((struct timeval*)*timestamp,NULL);
|
gettimeofday((struct timeval*)*timestamp,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -104,11 +104,7 @@ extern Bool noXkbExtension;
|
||||||
#define XE_POINTER 1
|
#define XE_POINTER 1
|
||||||
#define XE_KEYBOARD 2
|
#define XE_KEYBOARD 2
|
||||||
|
|
||||||
#ifdef XINPUT
|
|
||||||
#define __EqEnqueue(ev) xf86eqEnqueue(ev)
|
|
||||||
#else
|
|
||||||
#define __EqEnqueue(ev) mieqEnqueue(ev)
|
#define __EqEnqueue(ev) mieqEnqueue(ev)
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EqEnqueue(ev) { \
|
#define EqEnqueue(ev) { \
|
||||||
int __sigstate = xf86BlockSIGIO (); \
|
int __sigstate = xf86BlockSIGIO (); \
|
||||||
|
@ -253,11 +249,7 @@ ProcessInputEvents ()
|
||||||
|
|
||||||
xf86Info.inputPending = FALSE;
|
xf86Info.inputPending = FALSE;
|
||||||
|
|
||||||
#ifdef XINPUT
|
|
||||||
xf86eqProcessInputEvents();
|
|
||||||
#else
|
|
||||||
mieqProcessInputEvents();
|
mieqProcessInputEvents();
|
||||||
#endif
|
|
||||||
miPointerUpdate();
|
miPointerUpdate();
|
||||||
|
|
||||||
miPointerPosition(&x, &y);
|
miPointerPosition(&x, &y);
|
||||||
|
@ -403,679 +395,6 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* xf86PostKbdEvent --
|
|
||||||
* Translate the raw hardware KbdEvent into an XEvent, and tell DIX
|
|
||||||
* about it. Scancode preprocessing and so on is done ...
|
|
||||||
*
|
|
||||||
* OS/2 specific xf86PostKbdEvent(key) has been moved to os-support/os2/os2_kbd.c
|
|
||||||
* as some things differ, and I did not want to scatter this routine with
|
|
||||||
* ifdefs further (hv).
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
extern u_char SpecialServerMap[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__UNIXOS2__)
|
|
||||||
void
|
|
||||||
xf86PostKbdEvent(unsigned key)
|
|
||||||
{
|
|
||||||
int scanCode = (key & 0x7f);
|
|
||||||
int specialkey = 0;
|
|
||||||
Bool down = (key & 0x80 ? FALSE : TRUE);
|
|
||||||
KeyClassRec *keyc = ((DeviceIntPtr)xf86Info.pKeyboard)->key;
|
|
||||||
Bool updateLeds = FALSE;
|
|
||||||
Bool UsePrefix = FALSE;
|
|
||||||
Bool Direction = FALSE;
|
|
||||||
xEvent kevent;
|
|
||||||
KeySym *keysym;
|
|
||||||
int keycode;
|
|
||||||
static int lockkeys = 0;
|
|
||||||
#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
|
|
||||||
static Bool first_time = TRUE;
|
|
||||||
#endif
|
|
||||||
#if defined(__sparc__) && defined(__linux__)
|
|
||||||
static int kbdSun = -1;
|
|
||||||
#endif
|
|
||||||
/* Disable any keyboard processing while in suspend */
|
|
||||||
if (xf86inSuspend)
|
|
||||||
return;
|
|
||||||
|
|
||||||
#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
|
|
||||||
if (first_time)
|
|
||||||
{
|
|
||||||
first_time = FALSE;
|
|
||||||
VTSwitchEnabled = (xf86Info.consType == SYSCONS)
|
|
||||||
|| (xf86Info.consType == PCVT);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (__sparc__) && defined(__linux__)
|
|
||||||
if (kbdSun == -1) {
|
|
||||||
if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun"))
|
|
||||||
|| (xf86Info.xkbrules && !strcmp(xf86Info.xkbrules, "sun")))
|
|
||||||
kbdSun = 1;
|
|
||||||
else
|
|
||||||
kbdSun = 0;
|
|
||||||
}
|
|
||||||
if (kbdSun)
|
|
||||||
goto special;
|
|
||||||
#endif /* __sparc__ && __linux__ */
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
if (xf86Info.kbdCustomKeycodes) {
|
|
||||||
specialkey = SpecialServerMap[scanCode];
|
|
||||||
goto customkeycodes;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* First do some special scancode remapping ...
|
|
||||||
*/
|
|
||||||
if (xf86Info.scanPrefix == 0) {
|
|
||||||
|
|
||||||
switch (scanCode) {
|
|
||||||
case KEY_Prefix0:
|
|
||||||
case KEY_Prefix1:
|
|
||||||
#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
|
|
||||||
if (xf86Info.consType == PCCONS || xf86Info.consType == SYSCONS
|
|
||||||
|| xf86Info.consType == PCVT
|
|
||||||
#ifdef WSCONS_SUPPORT
|
|
||||||
|| (xf86Info.consType == WSCONS && xf86Info.kbdEvents != xf86WSKbdEvents)
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
#endif
|
|
||||||
xf86Info.scanPrefix = scanCode; /* special prefixes */
|
|
||||||
return;
|
|
||||||
#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#if defined (i386) && defined (SVR4)
|
|
||||||
/*
|
|
||||||
* PANIX returns DICOP standards based keycodes in using 106jp
|
|
||||||
* keyboard. We need to remap some keys.
|
|
||||||
*/
|
|
||||||
if(xf86Info.panix106 == TRUE){
|
|
||||||
switch (scanCode) {
|
|
||||||
case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */
|
|
||||||
case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/
|
|
||||||
case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */
|
|
||||||
case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */
|
|
||||||
case 0x6B: scanCode = KEY_Left; break; /* Cur Left */
|
|
||||||
case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */
|
|
||||||
case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */
|
|
||||||
case 0x73: scanCode = KEY_RCtrl; break; /* not needed */
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
#endif /* i386 && SVR4 */
|
|
||||||
{
|
|
||||||
switch (scanCode) {
|
|
||||||
case 0x59: scanCode = KEY_0x59; break;
|
|
||||||
case 0x5a: scanCode = KEY_0x5A; break;
|
|
||||||
case 0x5b: scanCode = KEY_0x5B; break;
|
|
||||||
case 0x5c: scanCode = KEY_KP_Equal; break; /* Keypad Equal */
|
|
||||||
case 0x5d: scanCode = KEY_0x5D; break;
|
|
||||||
case 0x5e: scanCode = KEY_0x5E; break;
|
|
||||||
case 0x5f: scanCode = KEY_0x5F; break;
|
|
||||||
case 0x62: scanCode = KEY_0x62; break;
|
|
||||||
case 0x63: scanCode = KEY_0x63; break;
|
|
||||||
case 0x64: scanCode = KEY_0x64; break;
|
|
||||||
case 0x65: scanCode = KEY_0x65; break;
|
|
||||||
case 0x66: scanCode = KEY_0x66; break;
|
|
||||||
case 0x67: scanCode = KEY_0x67; break;
|
|
||||||
case 0x68: scanCode = KEY_0x68; break;
|
|
||||||
case 0x69: scanCode = KEY_0x69; break;
|
|
||||||
case 0x6a: scanCode = KEY_0x6A; break;
|
|
||||||
case 0x6b: scanCode = KEY_0x6B; break;
|
|
||||||
case 0x6c: scanCode = KEY_0x6C; break;
|
|
||||||
case 0x6d: scanCode = KEY_0x6D; break;
|
|
||||||
case 0x6e: scanCode = KEY_0x6E; break;
|
|
||||||
case 0x6f: scanCode = KEY_0x6F; break;
|
|
||||||
case 0x70: scanCode = KEY_0x70; break;
|
|
||||||
case 0x71: scanCode = KEY_0x71; break;
|
|
||||||
case 0x72: scanCode = KEY_0x72; break;
|
|
||||||
case 0x73: scanCode = KEY_0x73; break;
|
|
||||||
case 0x74: scanCode = KEY_0x74; break;
|
|
||||||
case 0x75: scanCode = KEY_0x75; break;
|
|
||||||
case 0x76: scanCode = KEY_0x76; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (
|
|
||||||
#ifdef CSRG_BASED
|
|
||||||
(xf86Info.consType == PCCONS || xf86Info.consType == SYSCONS
|
|
||||||
|| xf86Info.consType == PCVT
|
|
||||||
#ifdef WSCONS_SUPPORT
|
|
||||||
|| (xf86Info.consType == WSCONS && xf86Info.kbdEvents !=
|
|
||||||
xf86WSKbdEvents)
|
|
||||||
#endif
|
|
||||||
) &&
|
|
||||||
#endif
|
|
||||||
(xf86Info.scanPrefix == KEY_Prefix0)) {
|
|
||||||
xf86Info.scanPrefix = 0;
|
|
||||||
|
|
||||||
switch (scanCode) {
|
|
||||||
case KEY_KP_7: scanCode = KEY_Home; break; /* curs home */
|
|
||||||
case KEY_KP_8: scanCode = KEY_Up; break; /* curs up */
|
|
||||||
case KEY_KP_9: scanCode = KEY_PgUp; break; /* curs pgup */
|
|
||||||
case KEY_KP_4: scanCode = KEY_Left; break; /* curs left */
|
|
||||||
case KEY_KP_5: scanCode = KEY_Begin; break; /* curs begin */
|
|
||||||
case KEY_KP_6: scanCode = KEY_Right; break; /* curs right */
|
|
||||||
case KEY_KP_1: scanCode = KEY_End; break; /* curs end */
|
|
||||||
case KEY_KP_2: scanCode = KEY_Down; break; /* curs down */
|
|
||||||
case KEY_KP_3: scanCode = KEY_PgDown; break; /* curs pgdown */
|
|
||||||
case KEY_KP_0: scanCode = KEY_Insert; break; /* curs insert */
|
|
||||||
case KEY_KP_Decimal: scanCode = KEY_Delete; break; /* curs delete */
|
|
||||||
case KEY_Enter: scanCode = KEY_KP_Enter; break; /* keypad enter */
|
|
||||||
case KEY_LCtrl: scanCode = KEY_RCtrl; break; /* right ctrl */
|
|
||||||
case KEY_KP_Multiply: scanCode = KEY_Print; break; /* print */
|
|
||||||
case KEY_Slash: scanCode = KEY_KP_Divide; break; /* keyp divide */
|
|
||||||
case KEY_Alt: scanCode = KEY_AltLang; break; /* right alt */
|
|
||||||
case KEY_ScrollLock: scanCode = KEY_Break; break; /* curs break */
|
|
||||||
case 0x5b: scanCode = KEY_LMeta; break;
|
|
||||||
case 0x5c: scanCode = KEY_RMeta; break;
|
|
||||||
case 0x5d: scanCode = KEY_Menu; break;
|
|
||||||
case KEY_F3: scanCode = KEY_F13; break;
|
|
||||||
case KEY_F4: scanCode = KEY_F14; break;
|
|
||||||
case KEY_F5: scanCode = KEY_F15; break;
|
|
||||||
case KEY_F6: scanCode = KEY_F16; break;
|
|
||||||
case KEY_F7: scanCode = KEY_F17; break;
|
|
||||||
case KEY_KP_Plus: scanCode = KEY_KP_DEC; break;
|
|
||||||
/*
|
|
||||||
* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6)
|
|
||||||
*/
|
|
||||||
case 0x2A:
|
|
||||||
case 0x36:
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
xf86MsgVerb(X_INFO, 4, "Unreported Prefix0 scancode: 0x%02x\n",
|
|
||||||
scanCode);
|
|
||||||
/*
|
|
||||||
* "Internet" keyboards are generating lots of new codes. Let them
|
|
||||||
* pass. There is little consistency between them, so don't bother
|
|
||||||
* with symbolic names at this level.
|
|
||||||
*/
|
|
||||||
scanCode += 0x78;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (xf86Info.scanPrefix == KEY_Prefix1)
|
|
||||||
{
|
|
||||||
xf86Info.scanPrefix = (scanCode == KEY_LCtrl) ? KEY_LCtrl : 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (xf86Info.scanPrefix == KEY_LCtrl)
|
|
||||||
{
|
|
||||||
xf86Info.scanPrefix = 0;
|
|
||||||
if (scanCode != KEY_NumLock) return;
|
|
||||||
scanCode = KEY_Pause; /* pause */
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef __sparc64__
|
|
||||||
/*
|
|
||||||
* PC keyboards generate separate key codes for
|
|
||||||
* Alt+Print and Control+Pause but in the X keyboard model
|
|
||||||
* they need to get the same key code as the base key on the same
|
|
||||||
* physical keyboard key.
|
|
||||||
*/
|
|
||||||
if (scanCode == KEY_SysReqest)
|
|
||||||
scanCode = KEY_Print;
|
|
||||||
else if (scanCode == KEY_Break)
|
|
||||||
scanCode = KEY_Pause;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* and now get some special keysequences
|
|
||||||
*/
|
|
||||||
|
|
||||||
specialkey = scanCode;
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
customkeycodes:
|
|
||||||
#endif
|
|
||||||
#if defined(i386) || defined(__i386__)
|
|
||||||
if (xf86IsPc98()) {
|
|
||||||
switch (scanCode) {
|
|
||||||
case 0x0e: specialkey = 0x0e; break; /* KEY_BackSpace */
|
|
||||||
case 0x40: specialkey = 0x4a; break; /* KEY_KP_Minus */
|
|
||||||
case 0x49: specialkey = 0x4e; break; /* KEY_KP_Plus */
|
|
||||||
|
|
||||||
/* XXX needs cases for KEY_KP_Divide and KEY_KP_Multiply */
|
|
||||||
|
|
||||||
case 0x62: specialkey = 0x3b; break; /* KEY_F1 */
|
|
||||||
case 0x63: specialkey = 0x3c; break; /* KEY_F2 */
|
|
||||||
case 0x64: specialkey = 0x3d; break; /* KEY_F3 */
|
|
||||||
case 0x65: specialkey = 0x3e; break; /* KEY_F4 */
|
|
||||||
case 0x66: specialkey = 0x3f; break; /* KEY_F5 */
|
|
||||||
case 0x67: specialkey = 0x40; break; /* KEY_F6 */
|
|
||||||
case 0x68: specialkey = 0x41; break; /* KEY_F7 */
|
|
||||||
case 0x69: specialkey = 0x42; break; /* KEY_F8 */
|
|
||||||
case 0x6a: specialkey = 0x43; break; /* KEY_F9 */
|
|
||||||
case 0x6b: specialkey = 0x44; break; /* KEY_F10 */
|
|
||||||
/* case 0x73: specialkey = 0x38; break; KEY_Alt */
|
|
||||||
/* case 0x74: specialkey = 0x1d; break; KEY_LCtrl */
|
|
||||||
default: specialkey = 0x00; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if defined (__sparc__) && defined(__linux__)
|
|
||||||
special:
|
|
||||||
if (kbdSun) {
|
|
||||||
switch (scanCode) {
|
|
||||||
case 0x2b: specialkey = KEY_BackSpace; break;
|
|
||||||
case 0x47: specialkey = KEY_KP_Minus; break;
|
|
||||||
case 0x7d: specialkey = KEY_KP_Plus; break;
|
|
||||||
|
|
||||||
/* XXX needs cases for KEY_KP_Divide and KEY_KP_Multiply */
|
|
||||||
|
|
||||||
case 0x05: specialkey = KEY_F1; break;
|
|
||||||
case 0x06: specialkey = KEY_F2; break;
|
|
||||||
case 0x08: specialkey = KEY_F3; break;
|
|
||||||
case 0x0a: specialkey = KEY_F4; break;
|
|
||||||
case 0x0c: specialkey = KEY_F5; break;
|
|
||||||
case 0x0e: specialkey = KEY_F6; break;
|
|
||||||
case 0x10: specialkey = KEY_F7; break;
|
|
||||||
case 0x11: specialkey = KEY_F8; break;
|
|
||||||
case 0x12: specialkey = KEY_F9; break;
|
|
||||||
case 0x07: specialkey = KEY_F10; break;
|
|
||||||
case 0x09: specialkey = KEY_F11; break;
|
|
||||||
case 0x0b: specialkey = KEY_F12; break;
|
|
||||||
default: specialkey = 0; break;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* XXX XXX XXX:
|
|
||||||
*
|
|
||||||
* I really don't know what's wrong here, but passing the real
|
|
||||||
* scanCode offsets by one from XKB's point of view.
|
|
||||||
*
|
|
||||||
* (ecd@skynet.be, 980405)
|
|
||||||
*/
|
|
||||||
scanCode--;
|
|
||||||
}
|
|
||||||
#endif /* defined (__sparc__) && defined(__linux__) */
|
|
||||||
|
|
||||||
#ifdef XKB
|
|
||||||
if ((xf86Info.ddxSpecialKeys == SKWhenNeeded &&
|
|
||||||
!xf86Info.ActionKeyBindingsSet) ||
|
|
||||||
noXkbExtension || xf86Info.ddxSpecialKeys == SKAlways) {
|
|
||||||
#endif
|
|
||||||
if (!(ModifierDown(ShiftMask)) &&
|
|
||||||
((ModifierDown(ControlMask | AltMask)) ||
|
|
||||||
(ModifierDown(ControlMask | AltLangMask))))
|
|
||||||
{
|
|
||||||
switch (specialkey) {
|
|
||||||
|
|
||||||
case KEY_BackSpace:
|
|
||||||
xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check grabs
|
|
||||||
*/
|
|
||||||
case KEY_KP_Divide:
|
|
||||||
xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
|
|
||||||
break;
|
|
||||||
case KEY_KP_Multiply:
|
|
||||||
xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Video mode switches
|
|
||||||
*/
|
|
||||||
case KEY_KP_Minus: /* Keypad - */
|
|
||||||
if (down) xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
|
|
||||||
if (!xf86Info.dontZoom) return;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case KEY_KP_Plus: /* Keypad + */
|
|
||||||
if (down) xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
|
|
||||||
if (!xf86Info.dontZoom) return;
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* Under QNX4, we set the vtPending flag for VT switching and
|
|
||||||
* let the VT switch function do the rest...
|
|
||||||
* This is a little different from the other OS'es.
|
|
||||||
*/
|
|
||||||
#if defined(QNX4)
|
|
||||||
case KEY_1:
|
|
||||||
case KEY_2:
|
|
||||||
case KEY_3:
|
|
||||||
case KEY_4:
|
|
||||||
case KEY_5:
|
|
||||||
case KEY_6:
|
|
||||||
case KEY_7:
|
|
||||||
case KEY_8:
|
|
||||||
case KEY_9:
|
|
||||||
if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
|
|
||||||
if (down) {
|
|
||||||
int vtno = specialkey - KEY_1 + 1;
|
|
||||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(linux) || (defined(CSRG_BASED) && (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT))) || defined(__SCO__) || defined(__UNIXWARE__)
|
|
||||||
/*
|
|
||||||
* Under Linux, the raw keycodes are consumed before the kernel
|
|
||||||
* does any processing on them, so we must emulate the vt switching
|
|
||||||
* we want ourselves.
|
|
||||||
*/
|
|
||||||
case KEY_F1:
|
|
||||||
case KEY_F2:
|
|
||||||
case KEY_F3:
|
|
||||||
case KEY_F4:
|
|
||||||
case KEY_F5:
|
|
||||||
case KEY_F6:
|
|
||||||
case KEY_F7:
|
|
||||||
case KEY_F8:
|
|
||||||
case KEY_F9:
|
|
||||||
case KEY_F10:
|
|
||||||
case KEY_F11:
|
|
||||||
case KEY_F12:
|
|
||||||
if ((VTSwitchEnabled && !xf86Info.vtSysreq && !xf86Info.dontVTSwitch)
|
|
||||||
#if (defined(CSRG_BASED) && (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)))
|
|
||||||
&& (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
int vtno = specialkey - KEY_F1 + 1;
|
|
||||||
if (specialkey == KEY_F11 || specialkey == KEY_F12)
|
|
||||||
vtno = specialkey - KEY_F11 + 11;
|
|
||||||
if (down)
|
|
||||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif /* linux || BSD with VTs */
|
|
||||||
|
|
||||||
/* just worth mentioning here: any 386bsd keyboard driver
|
|
||||||
* (pccons.c or co_kbd.c) catches CTRL-ALT-DEL and CTRL-ALT-ESC
|
|
||||||
* before any application (e.g. XF86) will see it
|
|
||||||
* OBS: syscons does not, nor does pcvt !
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Start of actual Solaris VT switching code.
|
|
||||||
* This should pretty much emulate standard SVR4 switching keys.
|
|
||||||
*
|
|
||||||
* DWH 12/2/93
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef USE_VT_SYSREQ
|
|
||||||
if (VTSwitchEnabled && xf86Info.vtSysreq && !xf86Info.dontVTSwitch)
|
|
||||||
{
|
|
||||||
switch (specialkey)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* syscons on *BSD doesn't have a VT #0 -- don't think Linux does
|
|
||||||
* either
|
|
||||||
*/
|
|
||||||
#if defined (sun) && defined (i386) && defined (SVR4)
|
|
||||||
case KEY_H:
|
|
||||||
if (VTSysreqToggle && down)
|
|
||||||
{
|
|
||||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN, NULL);
|
|
||||||
VTSysreqToggle = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Yah, I know the N, and P keys seem backwards, however that's
|
|
||||||
* how they work under Solaris
|
|
||||||
* XXXX N means go to next active VT not necessarily vtno+1 (or vtno-1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
case KEY_N:
|
|
||||||
if (VTSysreqToggle && down)
|
|
||||||
{
|
|
||||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL);
|
|
||||||
VTSysreqToggle = FALSE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case KEY_P:
|
|
||||||
if (VTSysreqToggle && down)
|
|
||||||
{
|
|
||||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL);
|
|
||||||
VTSysreqToggle = FALSE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case KEY_F1:
|
|
||||||
case KEY_F2:
|
|
||||||
case KEY_F3:
|
|
||||||
case KEY_F4:
|
|
||||||
case KEY_F5:
|
|
||||||
case KEY_F6:
|
|
||||||
case KEY_F7:
|
|
||||||
case KEY_F8:
|
|
||||||
case KEY_F9:
|
|
||||||
case KEY_F10:
|
|
||||||
case KEY_F11:
|
|
||||||
case KEY_F12:
|
|
||||||
if (VTSysreqToggle && down)
|
|
||||||
{ int vtno = specialkey - KEY_F1 + 1;
|
|
||||||
if (specialkey == KEY_F11 || specialkey == KEY_F12)
|
|
||||||
vtno = specialkey - KEY_F11 + 11;
|
|
||||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
|
|
||||||
VTSysreqToggle = FALSE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* Ignore these keys -- ie don't let them cancel an alt-sysreq */
|
|
||||||
case KEY_Alt:
|
|
||||||
case KEY_AltLang:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case KEY_SysReqest:
|
|
||||||
if (down && (ModifierDown(AltMask) || ModifierDown(AltLangMask)))
|
|
||||||
VTSysreqToggle = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if (VTSysreqToggle)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* We only land here when Alt-SysReq is followed by a
|
|
||||||
* non-switching key.
|
|
||||||
*/
|
|
||||||
VTSysreqToggle = FALSE;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* USE_VT_SYSREQ */
|
|
||||||
|
|
||||||
#ifdef __SCO__
|
|
||||||
/*
|
|
||||||
* With the console in raw mode, SCO will not switch consoles,
|
|
||||||
* you get around this by activating the next console along, if
|
|
||||||
* this fails then go back to console 0, if there is only one
|
|
||||||
* then it doesn't matter, switching to yourself is a nop as far
|
|
||||||
* as the console driver is concerned.
|
|
||||||
* We could do something similar to linux here but SCO ODT uses
|
|
||||||
* Ctrl-PrintScrn, so why change?
|
|
||||||
*/
|
|
||||||
if (specialkey == KEY_Print && ModifierDown(ControlMask)) {
|
|
||||||
if (down)
|
|
||||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif /* __SCO__ */
|
|
||||||
#ifdef XKB
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Now map the scancodes to real X-keycodes ...
|
|
||||||
*/
|
|
||||||
keycode = scanCode + MIN_KEYCODE;
|
|
||||||
keysym = (keyc->curKeySyms.map +
|
|
||||||
keyc->curKeySyms.mapWidth *
|
|
||||||
(keycode - keyc->curKeySyms.minKeyCode));
|
|
||||||
#ifdef XKB
|
|
||||||
if (noXkbExtension) {
|
|
||||||
#endif
|
|
||||||
/*
|
|
||||||
* Filter autorepeated caps/num/scroll lock keycodes.
|
|
||||||
*/
|
|
||||||
#define CAPSFLAG 0x01
|
|
||||||
#define NUMFLAG 0x02
|
|
||||||
#define SCROLLFLAG 0x04
|
|
||||||
#define MODEFLAG 0x08
|
|
||||||
if( down ) {
|
|
||||||
switch( keysym[0] ) {
|
|
||||||
case XK_Caps_Lock :
|
|
||||||
if (lockkeys & CAPSFLAG)
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
lockkeys |= CAPSFLAG;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XK_Num_Lock :
|
|
||||||
if (lockkeys & NUMFLAG)
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
lockkeys |= NUMFLAG;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XK_Scroll_Lock :
|
|
||||||
if (lockkeys & SCROLLFLAG)
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
lockkeys |= SCROLLFLAG;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (keysym[1] == XF86XK_ModeLock)
|
|
||||||
{
|
|
||||||
if (lockkeys & MODEFLAG)
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
lockkeys |= MODEFLAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
switch( keysym[0] ) {
|
|
||||||
case XK_Caps_Lock :
|
|
||||||
lockkeys &= ~CAPSFLAG;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XK_Num_Lock :
|
|
||||||
lockkeys &= ~NUMFLAG;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XK_Scroll_Lock :
|
|
||||||
lockkeys &= ~SCROLLFLAG;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (keysym[1] == XF86XK_ModeLock)
|
|
||||||
lockkeys &= ~MODEFLAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* LockKey special handling:
|
|
||||||
* ignore releases, toggle on & off on presses.
|
|
||||||
* Don't deal with the Caps_Lock keysym directly, but check the lock modifier
|
|
||||||
*/
|
|
||||||
if (keyc->modifierMap[keycode] & LockMask ||
|
|
||||||
keysym[0] == XK_Scroll_Lock ||
|
|
||||||
keysym[1] == XF86XK_ModeLock ||
|
|
||||||
keysym[0] == XK_Num_Lock)
|
|
||||||
{
|
|
||||||
Bool flag;
|
|
||||||
|
|
||||||
if (!down) return;
|
|
||||||
if (KeyPressed(keycode)) {
|
|
||||||
down = !down;
|
|
||||||
flag = FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
flag = TRUE;
|
|
||||||
|
|
||||||
if (keyc->modifierMap[keycode] & LockMask) xf86Info.capsLock = flag;
|
|
||||||
if (keysym[0] == XK_Num_Lock) xf86Info.numLock = flag;
|
|
||||||
if (keysym[0] == XK_Scroll_Lock) xf86Info.scrollLock = flag;
|
|
||||||
if (keysym[1] == XF86XK_ModeLock) xf86Info.modeSwitchLock = flag;
|
|
||||||
updateLeds = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!xf86Info.kbdCustomKeycodes) {
|
|
||||||
/*
|
|
||||||
* normal, non-keypad keys
|
|
||||||
*/
|
|
||||||
if (scanCode < KEY_KP_7 || scanCode > KEY_KP_Decimal) {
|
|
||||||
#if !defined(CSRG_BASED) && \
|
|
||||||
!defined(__GNU__) && \
|
|
||||||
defined(KB_84)
|
|
||||||
/*
|
|
||||||
* magic ALT_L key on AT84 keyboards for multilingual support
|
|
||||||
*/
|
|
||||||
if (xf86Info.kbdType == KB_84 &&
|
|
||||||
ModifierDown(AltMask) &&
|
|
||||||
keysym[2] != NoSymbol)
|
|
||||||
{
|
|
||||||
UsePrefix = TRUE;
|
|
||||||
Direction = TRUE;
|
|
||||||
}
|
|
||||||
#endif /* !CSRG_BASED && ... */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (updateLeds) xf86UpdateKbdLeds();
|
|
||||||
#ifdef XKB
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* check for an autorepeat-event
|
|
||||||
*/
|
|
||||||
if (down && KeyPressed(keycode)) {
|
|
||||||
KbdFeedbackClassRec *kbdfeed = ((DeviceIntPtr)xf86Info.pKeyboard)->kbdfeed;
|
|
||||||
if ((xf86Info.autoRepeat != AutoRepeatModeOn) ||
|
|
||||||
keyc->modifierMap[keycode] ||
|
|
||||||
(kbdfeed && !(kbdfeed->ctrl.autoRepeats[keycode>>3] & ( 1<<(keycode&7) ))))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
xf86Info.lastEventTime = kevent.u.keyButtonPointer.time = GetTimeInMillis();
|
|
||||||
/*
|
|
||||||
* And now send these prefixes ...
|
|
||||||
* NOTE: There cannot be multiple Mode_Switch keys !!!!
|
|
||||||
*/
|
|
||||||
if (UsePrefix)
|
|
||||||
{
|
|
||||||
ENQUEUE(&kevent,
|
|
||||||
keyc->modifierKeyMap[keyc->maxKeysPerModifier*7],
|
|
||||||
(Direction ? KeyPress : KeyRelease),
|
|
||||||
XE_KEYBOARD);
|
|
||||||
ENQUEUE(&kevent, keycode, (down ? KeyPress : KeyRelease), XE_KEYBOARD);
|
|
||||||
ENQUEUE(&kevent,
|
|
||||||
keyc->modifierKeyMap[keyc->maxKeysPerModifier*7],
|
|
||||||
(Direction ? KeyRelease : KeyPress),
|
|
||||||
XE_KEYBOARD);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ENQUEUE(&kevent, keycode, (down ? KeyPress : KeyRelease), XE_KEYBOARD);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* !__UNIXOS2__ */
|
|
||||||
|
|
||||||
#define ModifierIsSet(k) ((modifiers & (k)) == (k))
|
#define ModifierIsSet(k) ((modifiers & (k)) == (k))
|
||||||
|
|
||||||
_X_EXPORT Bool
|
_X_EXPORT Bool
|
||||||
|
@ -1137,8 +456,6 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
|
||||||
|
|
||||||
XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices);
|
XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices);
|
||||||
if (XFD_ANYSET(&devicesWithInput)) {
|
if (XFD_ANYSET(&devicesWithInput)) {
|
||||||
if (xf86Info.kbdEvents)
|
|
||||||
(xf86Info.kbdEvents)();
|
|
||||||
pInfo = xf86InputDevs;
|
pInfo = xf86InputDevs;
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
if (pInfo->read_input && pInfo->fd >= 0 &&
|
if (pInfo->read_input && pInfo->fd >= 0 &&
|
||||||
|
@ -1161,8 +478,6 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
|
||||||
|
|
||||||
InputInfoPtr pInfo;
|
InputInfoPtr pInfo;
|
||||||
|
|
||||||
(xf86Info.kbdEvents)(); /* Under OS/2 and QNX, always call */
|
|
||||||
|
|
||||||
pInfo = xf86InputDevs;
|
pInfo = xf86InputDevs;
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
if (pInfo->read_input && pInfo->fd >= 0) {
|
if (pInfo->read_input && pInfo->fd >= 0) {
|
||||||
|
@ -1470,6 +785,67 @@ xf86SigMemDebug(int signo)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
xf86ReleaseKeys(DeviceIntPtr pDev)
|
||||||
|
{
|
||||||
|
KeyClassPtr keyc = NULL;
|
||||||
|
KeySym *map = NULL;
|
||||||
|
xEvent *events = NULL, ke;
|
||||||
|
int i = 0, j = 0, nevents = 0;
|
||||||
|
|
||||||
|
ErrorF("releasekeys: called on device %s (%d)\n", pDev->name, pDev->id);
|
||||||
|
|
||||||
|
if (!pDev || !pDev->key)
|
||||||
|
return;
|
||||||
|
|
||||||
|
keyc = pDev->key;
|
||||||
|
map = keyc->curKeySyms.map;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hmm... here is the biggest hack of every time !
|
||||||
|
* It may be possible that a switch-vt procedure has finished BEFORE
|
||||||
|
* you released all keys neccessary to do this. That peculiar behavior
|
||||||
|
* can fool the X-server pretty much, cause it assumes that some keys
|
||||||
|
* were not released. TWM may stuck alsmost completly....
|
||||||
|
* OK, what we are doing here is after returning from the vt-switch
|
||||||
|
* exeplicitely unrelease all keyboard keys before the input-devices
|
||||||
|
* are reenabled.
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (i = keyc->curKeySyms.minKeyCode, map = keyc->curKeySyms.map;
|
||||||
|
i < keyc->curKeySyms.maxKeyCode;
|
||||||
|
i++, map += keyc->curKeySyms.mapWidth) {
|
||||||
|
ErrorF("key %d: pressed is %s\n", i, KeyPressed(i) ? "true" : "false");
|
||||||
|
if (KeyPressed(i)) {
|
||||||
|
switch (*map) {
|
||||||
|
/* Don't release the lock keys */
|
||||||
|
case XK_Caps_Lock:
|
||||||
|
case XK_Shift_Lock:
|
||||||
|
case XK_Num_Lock:
|
||||||
|
case XK_Scroll_Lock:
|
||||||
|
case XK_Kana_Lock:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (pDev == inputInfo.keyboard) {
|
||||||
|
ke.u.keyButtonPointer.time = GetTimeInMillis();
|
||||||
|
ke.u.keyButtonPointer.rootX = 0;
|
||||||
|
ke.u.keyButtonPointer.rootY = 0;
|
||||||
|
ke.u.u.type = KeyRelease;
|
||||||
|
ke.u.u.detail = i;
|
||||||
|
(*pDev->public.processInputProc) (&ke, pDev, 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nevents = GetKeyboardEvents(&events, pDev, KeyRelease, i);
|
||||||
|
ErrorF("device %s: got %d events for %d key\n", pDev->name, nevents, i);
|
||||||
|
for (j = 0; j < nevents; j++)
|
||||||
|
mieqEnqueue(events++);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xf86VTSwitch --
|
* xf86VTSwitch --
|
||||||
* Handle requests for switching the vt.
|
* Handle requests for switching the vt.
|
||||||
|
@ -1515,7 +891,6 @@ xf86VTSwitch()
|
||||||
* Keep the order: Disable Device > LeaveVT
|
* Keep the order: Disable Device > LeaveVT
|
||||||
* EnterVT > EnableDevice
|
* EnterVT > EnableDevice
|
||||||
*/
|
*/
|
||||||
DisableDevice((DeviceIntPtr)xf86Info.pKeyboard);
|
|
||||||
pInfo = xf86InputDevs;
|
pInfo = xf86InputDevs;
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
DisableDevice(pInfo->dev);
|
DisableDevice(pInfo->dev);
|
||||||
|
@ -1556,12 +931,14 @@ xf86VTSwitch()
|
||||||
SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset);
|
SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset);
|
||||||
|
|
||||||
#if !defined(__UNIXOS2__)
|
#if !defined(__UNIXOS2__)
|
||||||
EnableDevice((DeviceIntPtr)xf86Info.pKeyboard);
|
|
||||||
pInfo = xf86InputDevs;
|
pInfo = xf86InputDevs;
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
|
xf86ReleaseKeys(pInfo->dev);
|
||||||
EnableDevice(pInfo->dev);
|
EnableDevice(pInfo->dev);
|
||||||
pInfo = pInfo->next;
|
pInfo = pInfo->next;
|
||||||
}
|
}
|
||||||
|
/* XXX HACK */
|
||||||
|
xf86ReleaseKeys(inputInfo.keyboard);
|
||||||
#endif /* !__UNIXOS2__ */
|
#endif /* !__UNIXOS2__ */
|
||||||
for (ih = InputHandlers; ih; ih = ih->next)
|
for (ih = InputHandlers; ih; ih = ih->next)
|
||||||
xf86EnableInputHandler(ih);
|
xf86EnableInputHandler(ih);
|
||||||
|
@ -1618,12 +995,14 @@ xf86VTSwitch()
|
||||||
SaveScreens(SCREEN_SAVER_FORCER,ScreenSaverReset);
|
SaveScreens(SCREEN_SAVER_FORCER,ScreenSaverReset);
|
||||||
|
|
||||||
#if !defined(__UNIXOS2__)
|
#if !defined(__UNIXOS2__)
|
||||||
EnableDevice((DeviceIntPtr)xf86Info.pKeyboard);
|
|
||||||
pInfo = xf86InputDevs;
|
pInfo = xf86InputDevs;
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
|
xf86ReleaseKeys(pInfo->dev);
|
||||||
EnableDevice(pInfo->dev);
|
EnableDevice(pInfo->dev);
|
||||||
pInfo = pInfo->next;
|
pInfo = pInfo->next;
|
||||||
}
|
}
|
||||||
|
/* XXX HACK */
|
||||||
|
xf86ReleaseKeys(inputInfo.keyboard);
|
||||||
#endif /* !__UNIXOS2__ */
|
#endif /* !__UNIXOS2__ */
|
||||||
|
|
||||||
for (ih = InputHandlers; ih; ih = ih->next)
|
for (ih = InputHandlers; ih; ih = ih->next)
|
||||||
|
@ -1745,9 +1124,6 @@ xf86ReloadInputDevs(int sig)
|
||||||
|
|
||||||
signal(sig, (void(*)(int))xf86ReloadInputDevs);
|
signal(sig, (void(*)(int))xf86ReloadInputDevs);
|
||||||
|
|
||||||
DisableDevice((DeviceIntPtr)xf86Info.pKeyboard);
|
|
||||||
EnableDevice((DeviceIntPtr)xf86Info.pKeyboard);
|
|
||||||
|
|
||||||
pInfo = xf86InputDevs;
|
pInfo = xf86InputDevs;
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
DisableDevice(pInfo->dev);
|
DisableDevice(pInfo->dev);
|
||||||
|
|
|
@ -94,9 +94,6 @@ InputInfoPtr xf86InputDevs = NULL;
|
||||||
/* Globals that video drivers may not access */
|
/* Globals that video drivers may not access */
|
||||||
|
|
||||||
xf86InfoRec xf86Info = {
|
xf86InfoRec xf86Info = {
|
||||||
NULL, /* pKeyboard */
|
|
||||||
NULL, /* kbdProc */
|
|
||||||
NULL, /* kbdEvents */
|
|
||||||
-1, /* consoleFd */
|
-1, /* consoleFd */
|
||||||
-1, /* kbdFd */
|
-1, /* kbdFd */
|
||||||
-1, /* vtno */
|
-1, /* vtno */
|
||||||
|
|
|
@ -155,6 +155,19 @@ xf86LookupInputDriver(const char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InputInfoPtr
|
||||||
|
xf86LookupInput(const char *name)
|
||||||
|
{
|
||||||
|
InputInfoPtr p;
|
||||||
|
|
||||||
|
for (p = xf86InputDevs; p != NULL; p = p->next) {
|
||||||
|
if (strcmp(name, p->name) == 0)
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
xf86AddModuleInfo(ModuleInfoPtr info, pointer module)
|
xf86AddModuleInfo(ModuleInfoPtr info, pointer module)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1006,18 +1006,6 @@ InitInput(argc, argv)
|
||||||
if (serverGeneration == 1) {
|
if (serverGeneration == 1) {
|
||||||
/* Call the PreInit function for each input device instance. */
|
/* Call the PreInit function for each input device instance. */
|
||||||
for (pDev = xf86ConfigLayout.inputs; pDev && pDev->identifier; pDev++) {
|
for (pDev = xf86ConfigLayout.inputs; pDev && pDev->identifier; pDev++) {
|
||||||
#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
|
|
||||||
/* XXX The keyboard driver is a special case for now. */
|
|
||||||
if (!xf86NameCmp(pDev->driver, "keyboard")) {
|
|
||||||
xf86MsgVerb(X_WARNING, 0, "*** WARNING the legacy keyboard driver \"keyboard\" is deprecated\n");
|
|
||||||
xf86MsgVerb(X_WARNING, 0, "*** and will be removed in the next release of the Xorg server.\n");
|
|
||||||
xf86MsgVerb(X_WARNING, 0, "*** Please consider using the the new \"kbd\" driver for \"%s\".\n",
|
|
||||||
pDev->identifier);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((pDrv = xf86LookupInputDriver(pDev->driver)) == NULL) {
|
if ((pDrv = xf86LookupInputDriver(pDev->driver)) == NULL) {
|
||||||
xf86Msg(X_ERROR, "No Input driver matching `%s'\n", pDev->driver);
|
xf86Msg(X_ERROR, "No Input driver matching `%s'\n", pDev->driver);
|
||||||
/* XXX For now, just continue. */
|
/* XXX For now, just continue. */
|
||||||
|
@ -1040,80 +1028,18 @@ InitInput(argc, argv)
|
||||||
xf86DeleteInput(pInfo, 0);
|
xf86DeleteInput(pInfo, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (pInfo->flags & XI86_CORE_KEYBOARD) {
|
|
||||||
if (coreKeyboard) {
|
|
||||||
xf86Msg(X_ERROR,
|
|
||||||
"Attempt to register more than one core keyboard (%s)\n",
|
|
||||||
pInfo->name);
|
|
||||||
pInfo->flags &= ~XI86_CORE_KEYBOARD;
|
|
||||||
} else {
|
|
||||||
if (!(pInfo->flags & XI86_KEYBOARD_CAPABLE)) {
|
|
||||||
/* XXX just a warning for now */
|
|
||||||
xf86Msg(X_WARNING,
|
|
||||||
"%s: does not have core keyboard capabilities\n",
|
|
||||||
pInfo->name);
|
|
||||||
}
|
|
||||||
coreKeyboard = pInfo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pInfo->flags & XI86_CORE_POINTER) {
|
|
||||||
if (corePointer) {
|
|
||||||
xf86Msg(X_ERROR,
|
|
||||||
"Attempt to register more than one core pointer (%s)\n",
|
|
||||||
pInfo->name);
|
|
||||||
pInfo->flags &= ~XI86_CORE_POINTER;
|
|
||||||
} else {
|
|
||||||
if (!(pInfo->flags & XI86_POINTER_CAPABLE)) {
|
|
||||||
/* XXX just a warning for now */
|
|
||||||
xf86Msg(X_WARNING,
|
|
||||||
"%s: does not have core pointer capabilities\n",
|
|
||||||
pInfo->name);
|
|
||||||
}
|
|
||||||
corePointer = pInfo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!corePointer) {
|
|
||||||
xf86Msg(X_WARNING, "No core pointer registered\n");
|
|
||||||
/* XXX register a dummy core pointer */
|
|
||||||
}
|
|
||||||
#ifdef NEW_KBD
|
|
||||||
if (!coreKeyboard) {
|
|
||||||
xf86Msg(X_WARNING, "No core keyboard registered\n");
|
|
||||||
/* XXX register a dummy core keyboard */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialise all input devices. */
|
/* Initialise all input devices. */
|
||||||
pInfo = xf86InputDevs;
|
pInfo = xf86InputDevs;
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
|
xf86Msg(X_INFO, "evaluating device (%s)\n", pInfo->name);
|
||||||
xf86ActivateDevice(pInfo);
|
xf86ActivateDevice(pInfo);
|
||||||
pInfo = pInfo->next;
|
pInfo = pInfo->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coreKeyboard) {
|
mieqInit();
|
||||||
xf86Info.pKeyboard = coreKeyboard->dev;
|
|
||||||
xf86Info.kbdEvents = NULL; /* to prevent the internal keybord driver usage*/
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#ifdef USE_DEPRECATED_KEYBOARD_DRIVER
|
|
||||||
/* Only set this if we're allowing the old driver. */
|
|
||||||
if (xf86Info.kbdProc != NULL)
|
|
||||||
xf86Info.pKeyboard = AddInputDevice(xf86Info.kbdProc, TRUE);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (corePointer)
|
|
||||||
xf86Info.pMouse = corePointer->dev;
|
|
||||||
if (xf86Info.pKeyboard)
|
|
||||||
RegisterKeyboardDevice(xf86Info.pKeyboard);
|
|
||||||
|
|
||||||
miRegisterPointerDevice(screenInfo.screens[0], xf86Info.pMouse);
|
|
||||||
#ifdef XINPUT
|
|
||||||
xf86eqInit ((DevicePtr)xf86Info.pKeyboard, (DevicePtr)xf86Info.pMouse);
|
|
||||||
#else
|
|
||||||
mieqInit ((DevicePtr)xf86Info.pKeyboard, (DevicePtr)xf86Info.pMouse);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SET_STDERR_NONBLOCKING
|
#ifndef SET_STDERR_NONBLOCKING
|
||||||
|
@ -1232,12 +1158,6 @@ AbortDDX()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/*
|
|
||||||
* try to deinitialize all input devices
|
|
||||||
*/
|
|
||||||
if (xf86Info.kbdProc && xf86Info.pKeyboard)
|
|
||||||
(xf86Info.kbdProc)(xf86Info.pKeyboard, DEVICE_CLOSE);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* try to restore the original video state
|
* try to restore the original video state
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -160,313 +160,3 @@ xf86KbdLeds ()
|
||||||
xf86SetKbdLeds(real_leds);
|
xf86SetKbdLeds(real_leds);
|
||||||
(void)leds;
|
(void)leds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* xf86KbdCtrl --
|
|
||||||
* Alter some of the keyboard control parameters. All special protocol
|
|
||||||
* values are handled by dix (ProgChangeKeyboardControl)
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
xf86KbdCtrl (pKeyboard, ctrl)
|
|
||||||
DevicePtr pKeyboard; /* Keyboard to alter */
|
|
||||||
KeybdCtrl *ctrl;
|
|
||||||
{
|
|
||||||
int leds;
|
|
||||||
xf86Info.bell_pitch = ctrl->bell_pitch;
|
|
||||||
xf86Info.bell_duration = ctrl->bell_duration;
|
|
||||||
xf86Info.autoRepeat = ctrl->autoRepeat;
|
|
||||||
|
|
||||||
xf86Info.composeLock = (ctrl->leds & XCOMP) ? TRUE : FALSE;
|
|
||||||
|
|
||||||
leds = (ctrl->leds & ~(XCAPS | XNUM | XSCR));
|
|
||||||
#ifdef XKB
|
|
||||||
if (noXkbExtension) {
|
|
||||||
#endif
|
|
||||||
xf86Info.leds = (leds & xf86Info.xleds)|(xf86Info.leds & ~xf86Info.xleds);
|
|
||||||
#ifdef XKB
|
|
||||||
} else {
|
|
||||||
xf86Info.leds = leds;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
xf86KbdLeds();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xf86InitKBD --
|
|
||||||
* Reinitialize the keyboard. Only set Lockkeys according to ours leds.
|
|
||||||
* Depress all other keys.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
xf86InitKBD(init)
|
|
||||||
Bool init;
|
|
||||||
{
|
|
||||||
char leds = 0, rad;
|
|
||||||
unsigned int i;
|
|
||||||
xEvent kevent;
|
|
||||||
DeviceIntPtr pKeyboard = xf86Info.pKeyboard;
|
|
||||||
KeyClassRec *keyc = xf86Info.pKeyboard->key;
|
|
||||||
KeySym *map = keyc->curKeySyms.map;
|
|
||||||
|
|
||||||
kevent.u.keyButtonPointer.time = GetTimeInMillis();
|
|
||||||
kevent.u.keyButtonPointer.rootX = 0;
|
|
||||||
kevent.u.keyButtonPointer.rootY = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Hmm... here is the biggest hack of every time !
|
|
||||||
* It may be possible that a switch-vt procedure has finished BEFORE
|
|
||||||
* you released all keys neccessary to do this. That peculiar behavior
|
|
||||||
* can fool the X-server pretty much, cause it assumes that some keys
|
|
||||||
* were not released. TWM may stuck alsmost completly....
|
|
||||||
* OK, what we are doing here is after returning from the vt-switch
|
|
||||||
* exeplicitely unrelease all keyboard keys before the input-devices
|
|
||||||
* are reenabled.
|
|
||||||
*/
|
|
||||||
for (i = keyc->curKeySyms.minKeyCode, map = keyc->curKeySyms.map;
|
|
||||||
i < keyc->curKeySyms.maxKeyCode;
|
|
||||||
i++, map += keyc->curKeySyms.mapWidth)
|
|
||||||
if (KeyPressed(i))
|
|
||||||
{
|
|
||||||
switch (*map) {
|
|
||||||
/* Don't release the lock keys */
|
|
||||||
case XK_Caps_Lock:
|
|
||||||
case XK_Shift_Lock:
|
|
||||||
case XK_Num_Lock:
|
|
||||||
case XK_Scroll_Lock:
|
|
||||||
case XK_Kana_Lock:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
kevent.u.u.detail = i;
|
|
||||||
kevent.u.u.type = KeyRelease;
|
|
||||||
(* pKeyboard->public.processInputProc)(&kevent, pKeyboard, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
xf86Info.scanPrefix = 0;
|
|
||||||
|
|
||||||
if (init)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* we must deal here with the fact, that on some cases the numlock or
|
|
||||||
* capslock key are enabled BEFORE the server is started up. So look
|
|
||||||
* here at the state on the according LEDS to determine whether a
|
|
||||||
* lock-key is already set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
xf86Info.capsLock = FALSE;
|
|
||||||
xf86Info.numLock = FALSE;
|
|
||||||
xf86Info.scrollLock = FALSE;
|
|
||||||
xf86Info.modeSwitchLock = FALSE;
|
|
||||||
xf86Info.composeLock = FALSE;
|
|
||||||
|
|
||||||
#ifdef LED_CAP
|
|
||||||
#ifdef INHERIT_LOCK_STATE
|
|
||||||
leds = xf86Info.leds;
|
|
||||||
|
|
||||||
for (i = keyc->curKeySyms.minKeyCode, map = keyc->curKeySyms.map;
|
|
||||||
i < keyc->curKeySyms.maxKeyCode;
|
|
||||||
i++, map += keyc->curKeySyms.mapWidth)
|
|
||||||
|
|
||||||
switch(*map) {
|
|
||||||
|
|
||||||
case XK_Caps_Lock:
|
|
||||||
case XK_Shift_Lock:
|
|
||||||
if (leds & LED_CAP)
|
|
||||||
{
|
|
||||||
xf86InitialCaps = i;
|
|
||||||
xf86Info.capsLock = TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XK_Num_Lock:
|
|
||||||
if (leds & LED_NUM)
|
|
||||||
{
|
|
||||||
xf86InitialNum = i;
|
|
||||||
xf86Info.numLock = TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XK_Scroll_Lock:
|
|
||||||
case XK_Kana_Lock:
|
|
||||||
if (leds & LED_SCR)
|
|
||||||
{
|
|
||||||
xf86InitialScroll = i;
|
|
||||||
xf86Info.scrollLock = TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif /* INHERIT_LOCK_STATE */
|
|
||||||
xf86SetKbdLeds(leds);
|
|
||||||
#endif /* LED_CAP */
|
|
||||||
(void)leds;
|
|
||||||
|
|
||||||
if (xf86Info.kbdDelay <= 375) rad = 0x00;
|
|
||||||
else if (xf86Info.kbdDelay <= 625) rad = 0x20;
|
|
||||||
else if (xf86Info.kbdDelay <= 875) rad = 0x40;
|
|
||||||
else rad = 0x60;
|
|
||||||
|
|
||||||
if (xf86Info.kbdRate <= 2) rad |= 0x1F;
|
|
||||||
else if (xf86Info.kbdRate >= 30) rad |= 0x00;
|
|
||||||
else rad |= ((58 / xf86Info.kbdRate) - 2);
|
|
||||||
|
|
||||||
xf86SetKbdRepeat(rad);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xf86KbdProc --
|
|
||||||
* Handle the initialization, etc. of a keyboard.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
xf86KbdProc (pKeyboard, what)
|
|
||||||
DeviceIntPtr pKeyboard; /* Keyboard to manipulate */
|
|
||||||
int what; /* What to do to it */
|
|
||||||
{
|
|
||||||
KeySymsRec keySyms;
|
|
||||||
CARD8 modMap[MAP_LENGTH];
|
|
||||||
int kbdFd;
|
|
||||||
|
|
||||||
switch (what) {
|
|
||||||
|
|
||||||
case DEVICE_INIT:
|
|
||||||
/*
|
|
||||||
* First open and find the current state of the keyboard.
|
|
||||||
*/
|
|
||||||
|
|
||||||
xf86KbdInit();
|
|
||||||
|
|
||||||
xf86KbdGetMapping(&keySyms, modMap);
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef XKB
|
|
||||||
defaultKeyboardControl.leds = xf86GetKbdLeds();
|
|
||||||
#else
|
|
||||||
defaultKeyboardControl.leds = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Perform final initialization of the system private keyboard
|
|
||||||
* structure and fill in various slots in the device record
|
|
||||||
* itself which couldn't be filled in before.
|
|
||||||
*/
|
|
||||||
|
|
||||||
pKeyboard->public.on = FALSE;
|
|
||||||
|
|
||||||
#ifdef XKB
|
|
||||||
if (noXkbExtension) {
|
|
||||||
#endif
|
|
||||||
InitKeyboardDeviceStruct((DevicePtr)xf86Info.pKeyboard,
|
|
||||||
&keySyms,
|
|
||||||
modMap,
|
|
||||||
xf86KbdBell,
|
|
||||||
(KbdCtrlProcPtr)xf86KbdCtrl);
|
|
||||||
#ifdef XKB
|
|
||||||
} else {
|
|
||||||
XkbComponentNamesRec names;
|
|
||||||
XkbDescPtr desc;
|
|
||||||
Bool foundTerminate = FALSE;
|
|
||||||
int keyc;
|
|
||||||
if (xf86Info.xkbkeymap) {
|
|
||||||
names.keymap = xf86Info.xkbkeymap;
|
|
||||||
names.keycodes = NULL;
|
|
||||||
names.types = NULL;
|
|
||||||
names.compat = NULL;
|
|
||||||
names.symbols = NULL;
|
|
||||||
names.geometry = NULL;
|
|
||||||
} else {
|
|
||||||
names.keymap = NULL;
|
|
||||||
names.keycodes = xf86Info.xkbkeycodes;
|
|
||||||
names.types = xf86Info.xkbtypes;
|
|
||||||
names.compat = xf86Info.xkbcompat;
|
|
||||||
names.symbols = xf86Info.xkbsymbols;
|
|
||||||
names.geometry = xf86Info.xkbgeometry;
|
|
||||||
}
|
|
||||||
if ((xf86Info.xkbkeymap || xf86Info.xkbcomponents_specified)
|
|
||||||
&& (xf86Info.xkbmodel == NULL || xf86Info.xkblayout == NULL)) {
|
|
||||||
xf86Info.xkbrules = NULL;
|
|
||||||
}
|
|
||||||
XkbSetRulesDflts(xf86Info.xkbrules, xf86Info.xkbmodel,
|
|
||||||
xf86Info.xkblayout, xf86Info.xkbvariant,
|
|
||||||
xf86Info.xkboptions);
|
|
||||||
|
|
||||||
XkbInitKeyboardDeviceStruct(pKeyboard,
|
|
||||||
&names,
|
|
||||||
&keySyms,
|
|
||||||
modMap,
|
|
||||||
xf86KbdBell,
|
|
||||||
(KbdCtrlProcPtr)xf86KbdCtrl);
|
|
||||||
|
|
||||||
/* Search keymap for Terminate action */
|
|
||||||
desc = pKeyboard->key->xkbInfo->desc;
|
|
||||||
for (keyc = desc->min_key_code; keyc <= desc->max_key_code; keyc++) {
|
|
||||||
int i;
|
|
||||||
for (i = 1; i <= XkbKeyNumActions(desc, keyc); i++) {
|
|
||||||
if (XkbKeyAction(desc, keyc, i)
|
|
||||||
&& XkbKeyAction(desc, keyc, i)->type == XkbSA_Terminate) {
|
|
||||||
foundTerminate = TRUE;
|
|
||||||
goto searchdone;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
searchdone:
|
|
||||||
xf86Info.ActionKeyBindingsSet = foundTerminate;
|
|
||||||
if (!foundTerminate)
|
|
||||||
xf86Msg(X_INFO, "Server_Terminate keybinding not found\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
xf86InitKBD(TRUE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DEVICE_ON:
|
|
||||||
/*
|
|
||||||
* Set the keyboard into "direct" mode and turn on
|
|
||||||
* event translation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
kbdFd = xf86KbdOn();
|
|
||||||
/*
|
|
||||||
* Discard any pending input after a VT switch to prevent the server
|
|
||||||
* passing on parts of the VT switch sequence.
|
|
||||||
*/
|
|
||||||
sleep(1);
|
|
||||||
#if defined(WSCONS_SUPPORT)
|
|
||||||
if (xf86Info.consType != WSCONS) {
|
|
||||||
#endif
|
|
||||||
if (kbdFd != -1) {
|
|
||||||
char buf[16];
|
|
||||||
read(kbdFd, buf, 16);
|
|
||||||
}
|
|
||||||
#if defined(WSCONS_SUPPORT)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__UNIXOS2__) /* Under EMX, keyboard cannot be select()'ed */
|
|
||||||
if (kbdFd != -1)
|
|
||||||
AddEnabledDevice(kbdFd);
|
|
||||||
#endif /* __UNIXOS2__ */
|
|
||||||
|
|
||||||
pKeyboard->public.on = TRUE;
|
|
||||||
xf86InitKBD(FALSE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DEVICE_CLOSE:
|
|
||||||
case DEVICE_OFF:
|
|
||||||
/*
|
|
||||||
* Restore original keyboard directness and translation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
kbdFd = xf86KbdOff();
|
|
||||||
|
|
||||||
if (kbdFd != -1)
|
|
||||||
RemoveEnabledDevice(kbdFd);
|
|
||||||
|
|
||||||
pKeyboard->public.on = FALSE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return (Success);
|
|
||||||
}
|
|
||||||
|
|
|
@ -366,7 +366,7 @@ MiscExtCreateStruct(MiscExtStructType mse_or_kbd)
|
||||||
InputInfoPtr pInfo = xf86InputDevs;
|
InputInfoPtr pInfo = xf86InputDevs;
|
||||||
|
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
if (xf86IsCorePointer(pInfo->dev))
|
if (pInfo->dev == inputInfo.pointer)
|
||||||
break;
|
break;
|
||||||
pInfo = pInfo->next;
|
pInfo = pInfo->next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,9 +200,6 @@ void xf86KbdBell(int percent, DeviceIntPtr pKeyboard, pointer ctrl,
|
||||||
int unused);
|
int unused);
|
||||||
void xf86KbdLeds(void);
|
void xf86KbdLeds(void);
|
||||||
void xf86UpdateKbdLeds(void);
|
void xf86UpdateKbdLeds(void);
|
||||||
void xf86KbdCtrl(DevicePtr pKeyboard, KeybdCtrl *ctrl);
|
|
||||||
void xf86InitKBD(Bool init);
|
|
||||||
int xf86KbdProc(DeviceIntPtr pKeyboard, int what);
|
|
||||||
|
|
||||||
/* xf86Kbd.c */
|
/* xf86Kbd.c */
|
||||||
|
|
||||||
|
|
|
@ -68,11 +68,6 @@ typedef enum {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
||||||
/* keyboard part */
|
|
||||||
DeviceIntPtr pKeyboard;
|
|
||||||
DeviceProc kbdProc; /* procedure for initializing */
|
|
||||||
void (* kbdEvents)(void); /* proc for processing events */
|
|
||||||
int consoleFd;
|
int consoleFd;
|
||||||
int kbdFd;
|
int kbdFd;
|
||||||
int vtno;
|
int vtno;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -147,8 +147,6 @@ typedef struct _LocalDeviceRec {
|
||||||
unsigned int last;
|
unsigned int last;
|
||||||
int old_x;
|
int old_x;
|
||||||
int old_y;
|
int old_y;
|
||||||
float dxremaind;
|
|
||||||
float dyremaind;
|
|
||||||
char * type_name;
|
char * type_name;
|
||||||
IntegerFeedbackPtr always_core_feedback;
|
IntegerFeedbackPtr always_core_feedback;
|
||||||
IDevPtr conf_idev;
|
IDevPtr conf_idev;
|
||||||
|
@ -167,16 +165,7 @@ typedef struct _DeviceAssocRec
|
||||||
extern InputInfoPtr xf86InputDevs;
|
extern InputInfoPtr xf86InputDevs;
|
||||||
|
|
||||||
/* xf86Xinput.c */
|
/* xf86Xinput.c */
|
||||||
int xf86IsCorePointer(DeviceIntPtr dev);
|
|
||||||
int xf86IsCoreKeyboard(DeviceIntPtr dev);
|
|
||||||
void xf86XInputSetSendCoreEvents(LocalDevicePtr local, Bool always);
|
|
||||||
#define xf86AlwaysCore(a,b) xf86XInputSetSendCoreEvents(a,b)
|
|
||||||
|
|
||||||
void InitExtInput(void);
|
void InitExtInput(void);
|
||||||
Bool xf86eqInit(DevicePtr pKbd, DevicePtr pPtr);
|
|
||||||
void xf86eqEnqueue(struct _xEvent *event);
|
|
||||||
void xf86eqProcessInputEvents (void);
|
|
||||||
void xf86eqSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
|
|
||||||
void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
|
void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
|
||||||
int first_valuator, int num_valuators, ...);
|
int first_valuator, int num_valuators, ...);
|
||||||
void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
|
void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
|
||||||
|
@ -212,10 +201,16 @@ void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
|
||||||
void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
|
void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
|
||||||
void xf86DeleteInputDriver(int drvIndex);
|
void xf86DeleteInputDriver(int drvIndex);
|
||||||
InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
|
InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
|
||||||
|
InputDriverPtr xf86LookupInputDriver(const char *name);
|
||||||
|
InputInfoPtr xf86LookupInput(const char *name);
|
||||||
void xf86DeleteInput(InputInfoPtr pInp, int flags);
|
void xf86DeleteInput(InputInfoPtr pInp, int flags);
|
||||||
|
|
||||||
/* xf86Option.c */
|
/* xf86Option.c */
|
||||||
void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
|
void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
|
||||||
pointer extraOpts);
|
pointer extraOpts);
|
||||||
|
|
||||||
|
/* Legacy hatred */
|
||||||
|
#define SendCoreEvents 59
|
||||||
|
#define DontSendCoreEvents 60
|
||||||
|
|
||||||
#endif /* _xf86Xinput_h */
|
#endif /* _xf86Xinput_h */
|
||||||
|
|
|
@ -293,7 +293,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
||||||
SYMFUNC(xf86SoundKbdBell)
|
SYMFUNC(xf86SoundKbdBell)
|
||||||
SYMFUNC(xf86GARTCloseScreen)
|
SYMFUNC(xf86GARTCloseScreen)
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
/* XISB routines (Merged from Metrolink tree) */
|
|
||||||
SYMFUNC(XisbNew)
|
SYMFUNC(XisbNew)
|
||||||
SYMFUNC(XisbFree)
|
SYMFUNC(XisbFree)
|
||||||
SYMFUNC(XisbRead)
|
SYMFUNC(XisbRead)
|
||||||
|
@ -695,7 +694,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
||||||
/* xf86Xinput.c */
|
/* xf86Xinput.c */
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
SYMFUNC(xf86ProcessCommonOptions)
|
SYMFUNC(xf86ProcessCommonOptions)
|
||||||
SYMFUNC(xf86IsCorePointer)
|
|
||||||
SYMFUNC(xf86PostMotionEvent)
|
SYMFUNC(xf86PostMotionEvent)
|
||||||
SYMFUNC(xf86PostProximityEvent)
|
SYMFUNC(xf86PostProximityEvent)
|
||||||
SYMFUNC(xf86PostButtonEvent)
|
SYMFUNC(xf86PostButtonEvent)
|
||||||
|
@ -704,13 +702,9 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
||||||
SYMFUNC(xf86GetMotionEvents)
|
SYMFUNC(xf86GetMotionEvents)
|
||||||
SYMFUNC(xf86MotionHistoryAllocate)
|
SYMFUNC(xf86MotionHistoryAllocate)
|
||||||
SYMFUNC(xf86FirstLocalDevice)
|
SYMFUNC(xf86FirstLocalDevice)
|
||||||
SYMFUNC(xf86eqEnqueue)
|
|
||||||
SYMFUNC(xf86ActivateDevice)
|
SYMFUNC(xf86ActivateDevice)
|
||||||
/* The following segment merged from Metrolink tree */
|
|
||||||
SYMFUNC(xf86XInputSetScreen)
|
SYMFUNC(xf86XInputSetScreen)
|
||||||
SYMFUNC(xf86ScaleAxis)
|
SYMFUNC(xf86ScaleAxis)
|
||||||
SYMFUNC(xf86XInputSetSendCoreEvents)
|
|
||||||
/* End merged segment */
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef DPMSExtension
|
#ifdef DPMSExtension
|
||||||
SYMFUNC(DPMSGet)
|
SYMFUNC(DPMSGet)
|
||||||
|
|
Loading…
Reference in New Issue