First import
[xorg_rtime.git] / xorg-server-1.4 / hw / xfree86 / dixmods / xkbPrivate.c
blobe0cd21739e11f647aa3fe3cd1f5179ca9c2f8b58
2 #ifdef HAVE_DIX_CONFIG_H
3 #include <dix-config.h>
4 #endif
6 #ifdef HAVE_XORG_CONFIG_H
7 #include <xorg-config.h>
8 #endif
10 #include <stdio.h>
11 #define NEED_EVENTS 1
12 #include <X11/X.h>
13 #include "windowstr.h"
14 #define XKBSRV_NEED_FILE_FUNCS
15 #include <xkbsrv.h>
17 #include "xf86.h"
19 int
20 XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
22 XkbAnyAction *xf86act = &(act->any);
23 char msgbuf[XkbAnyActionDataSize+1];
25 if (xf86act->type == XkbSA_XFree86Private) {
26 memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
27 msgbuf[XkbAnyActionDataSize]= '\0';
28 if (strcasecmp(msgbuf, "-vmode")==0)
29 xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
30 else if (strcasecmp(msgbuf, "+vmode")==0)
31 xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
32 else if (strcasecmp(msgbuf, "ungrab")==0)
33 xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
34 else if (strcasecmp(msgbuf, "clsgrb")==0)
35 xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
36 else
37 xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf);
40 return 0;