11b5d61b8Smrg/************************************************************
21b5d61b8SmrgCopyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
31b5d61b8Smrg
41b5d61b8SmrgPermission to use, copy, modify, and distribute this
51b5d61b8Smrgsoftware and its documentation for any purpose and without
61b5d61b8Smrgfee is hereby granted, provided that the above copyright
71b5d61b8Smrgnotice appear in all copies and that both that copyright
81b5d61b8Smrgnotice and this permission notice appear in supporting
91b5d61b8Smrgdocumentation, and that the name of Silicon Graphics not be
101b5d61b8Smrgused in advertising or publicity pertaining to distribution
111b5d61b8Smrgof the software without specific prior written permission.
121b5d61b8SmrgSilicon Graphics makes no representation about the suitability
131b5d61b8Smrgof this software for any purpose. It is provided "as is"
141b5d61b8Smrgwithout any express or implied warranty.
151b5d61b8Smrg
161b5d61b8SmrgSILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
171b5d61b8SmrgSOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
181b5d61b8SmrgAND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
191b5d61b8SmrgGRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
201b5d61b8SmrgDAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
211b5d61b8SmrgDATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
221b5d61b8SmrgOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
231b5d61b8SmrgTHE USE OR PERFORMANCE OF THIS SOFTWARE.
241b5d61b8Smrg
251b5d61b8Smrg********************************************************/
261b5d61b8Smrg
271b5d61b8Smrg#ifdef HAVE_DIX_CONFIG_H
281b5d61b8Smrg#include <dix-config.h>
291b5d61b8Smrg#endif
301b5d61b8Smrg
311b5d61b8Smrg#ifdef HAVE_XORG_CONFIG_H
321b5d61b8Smrg#include <xorg-config.h>
331b5d61b8Smrg#endif
341b5d61b8Smrg
351b5d61b8Smrg#include <stdio.h>
361b5d61b8Smrg#include <X11/X.h>
371b5d61b8Smrg#include <X11/Xproto.h>
381b5d61b8Smrg#include <X11/keysym.h>
391b5d61b8Smrg#include "inputstr.h"
401b5d61b8Smrg#include "scrnintstr.h"
411b5d61b8Smrg#include "windowstr.h"
421b5d61b8Smrg#include <xkbsrv.h>
431b5d61b8Smrg#include <X11/extensions/XI.h>
441b5d61b8Smrg
451b5d61b8Smrg#include "xf86.h"
461b5d61b8Smrg
471b5d61b8Smrgint
481b5d61b8SmrgXkbDDXSwitchScreen(DeviceIntPtr dev, KeyCode key, XkbAction *act)
491b5d61b8Smrg{
501b5d61b8Smrg    int scrnnum = XkbSAScreen(&act->screen);
511b5d61b8Smrg
521b5d61b8Smrg    if (act->screen.flags & XkbSA_SwitchApplication) {
531b5d61b8Smrg        if (act->screen.flags & XkbSA_SwitchAbsolute)
541b5d61b8Smrg            xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &scrnnum);
551b5d61b8Smrg        else {
561b5d61b8Smrg            if (scrnnum < 0)
571b5d61b8Smrg                xf86ProcessActionEvent(ACTION_SWITCHSCREEN_PREV, NULL);
581b5d61b8Smrg            else
591b5d61b8Smrg                xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL);
601b5d61b8Smrg        }
611b5d61b8Smrg    }
621b5d61b8Smrg
631b5d61b8Smrg    return 1;
641b5d61b8Smrg}
65