2005-08-15 Alan Coopersmith <alan.coopersmith@sun.co>m

Convert sunPostKbdEvent to use xf86ProcessAction like xf86PostKbdEvent.
This commit is contained in:
Alan Coopersmith 2005-08-16 00:40:25 +00:00
parent b86282b764
commit 24597a1ee2

View File

@ -665,9 +665,6 @@ sunPostKbdEvent(int sun_ktype, Firm_event *event)
else else
down = FALSE; down = FALSE;
/*
* and now get some special keysequences
*/
#if defined(KB_USB) #if defined(KB_USB)
if(sun_ktype == KB_USB) if(sun_ktype == KB_USB)
@ -676,84 +673,55 @@ sunPostKbdEvent(int sun_ktype, Firm_event *event)
#endif #endif
keycode = map[event->id]; keycode = map[event->id];
if ((ModifierDown(ControlMask | AltMask)) || /*
(ModifierDown(ControlMask | AltLangMask))) * and now get some special keysequences
*/
#ifdef XKB
if (((xf86Info.ddxSpecialKeys == SKWhenNeeded) &&
(!xf86Info.ActionKeyBindingsSet)) ||
noXkbExtension || (xf86Info.ddxSpecialKeys == SKAlways))
#endif
{
if (!(ModifierDown(ShiftMask)) &&
((ModifierDown(ControlMask | AltMask)) ||
(ModifierDown(ControlMask | AltLangMask))))
{ {
switch (keycode) { switch (keycode) {
/* /*
* The idea here is to pass the scancode down to a list of registered * The idea here is to pass the scancode down to a list of
* routines. There should be some standard conventions for processing * registered routines. There should be some standard conventions
* certain keys. * for processing certain keys.
*/ */
case KEY_BackSpace: case KEY_BackSpace:
if (!xf86Info.dontZap) { xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
DGAShutdown();
GiveUp(0);
}
break; break;
/* Check grabs */ /*
* Check grabs
*/
case KEY_KP_Divide: case KEY_KP_Divide:
if (!xf86Info.grabInfo.disabled && xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
xf86Info.grabInfo.allowDeactivate) {
if (inputInfo.pointer && inputInfo.pointer->grab != NULL &&
inputInfo.pointer->DeactivateGrab)
(*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer);
if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL &&
inputInfo.keyboard->DeactivateGrab)
(*inputInfo.keyboard->DeactivateGrab)(inputInfo.keyboard);
}
break; break;
case KEY_KP_Multiply: case KEY_KP_Multiply:
if (!xf86Info.grabInfo.disabled && xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
xf86Info.grabInfo.allowClosedown) {
ClientPtr pointer, keyboard, server;
pointer = keyboard = server = NULL;
if (inputInfo.pointer && inputInfo.pointer->grab != NULL)
pointer =
clients[CLIENT_ID(inputInfo.pointer->grab->resource)];
if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL) {
keyboard =
clients[CLIENT_ID(inputInfo.keyboard->grab->resource)];
if (keyboard == pointer)
keyboard = NULL;
}
if ((xf86Info.grabInfo.server.grabstate == SERVER_GRABBED) &&
(((server = xf86Info.grabInfo.server.client) == pointer) ||
(server == keyboard)))
server = NULL;
if (pointer)
CloseDownClient(pointer);
if (keyboard)
CloseDownClient(keyboard);
if (server)
CloseDownClient(server);
}
break; break;
/*
* Video mode switches
*/
case KEY_KP_Minus: /* Keypad - */ case KEY_KP_Minus: /* Keypad - */
if (!xf86Info.dontZoom) { if (down) xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
if (down) if (!xf86Info.dontZoom) return;
xf86ZoomViewport(xf86Info.currentScreen, -1);
return;
}
break; break;
case KEY_KP_Plus: /* Keypad + */ case KEY_KP_Plus: /* Keypad + */
if (!xf86Info.dontZoom) { if (down) xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
if (down) if (!xf86Info.dontZoom) return;
xf86ZoomViewport(xf86Info.currentScreen, 1);
return;
}
break; break;
} }
} }
}
/* /*
* Now map the scancodes to real X-keycodes ... * Now map the scancodes to real X-keycodes ...