1
2#ifdef HAVE_DIX_CONFIG_H
3#include <dix-config.h>
4#endif
5
6#ifdef HAVE_XORG_CONFIG_H
7#include <xorg-config.h>
8#endif
9
10#include <stdio.h>
11#include <X11/X.h>
12#include "windowstr.h"
13#define XKBSRV_NEED_FILE_FUNCS
14#include <xkbsrv.h>
15
16#include "dixgrabs.h"
17#include "os.h"
18#include "xf86.h"
19
20int
21XkbDDXPrivate(DeviceIntPtr dev, KeyCode key, XkbAction *act)
22{
23    XkbAnyAction *xf86act = &(act->any);
24    char msgbuf[XkbAnyActionDataSize + 1];
25
26    if (xf86act->type == XkbSA_XFree86Private) {
27        memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
28        msgbuf[XkbAnyActionDataSize] = '\0';
29        if (strcasecmp(msgbuf, "-vmode") == 0)
30            xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
31        else if (strcasecmp(msgbuf, "+vmode") == 0)
32            xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
33    }
34
35    return 0;
36}
37