1706f2543Smrg/************************************************************ 2706f2543SmrgCopyright (c) 1993 by Silicon Graphics Computer Systems, Inc. 3706f2543Smrg 4706f2543SmrgPermission to use, copy, modify, and distribute this 5706f2543Smrgsoftware and its documentation for any purpose and without 6706f2543Smrgfee is hereby granted, provided that the above copyright 7706f2543Smrgnotice appear in all copies and that both that copyright 8706f2543Smrgnotice and this permission notice appear in supporting 9706f2543Smrgdocumentation, and that the name of Silicon Graphics not be 10706f2543Smrgused in advertising or publicity pertaining to distribution 11706f2543Smrgof the software without specific prior written permission. 12706f2543SmrgSilicon Graphics makes no representation about the suitability 13706f2543Smrgof this software for any purpose. It is provided "as is" 14706f2543Smrgwithout any express or implied warranty. 15706f2543Smrg 16706f2543SmrgSILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 17706f2543SmrgSOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18706f2543SmrgAND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON 19706f2543SmrgGRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 20706f2543SmrgDAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 21706f2543SmrgDATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 22706f2543SmrgOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH 23706f2543SmrgTHE USE OR PERFORMANCE OF THIS SOFTWARE. 24706f2543Smrg 25706f2543Smrg********************************************************/ 26706f2543Smrg 27706f2543Smrg#ifdef HAVE_DIX_CONFIG_H 28706f2543Smrg#include <dix-config.h> 29706f2543Smrg#endif 30706f2543Smrg 31706f2543Smrg#include <stdio.h> 32706f2543Smrg#include <X11/X.h> 33706f2543Smrg#include <X11/Xproto.h> 34706f2543Smrg#include <X11/keysym.h> 35706f2543Smrg#include "inputstr.h" 36706f2543Smrg#include "scrnintstr.h" 37706f2543Smrg#include "windowstr.h" 38706f2543Smrg#include <xkbsrv.h> 39706f2543Smrg#include <X11/extensions/XI.h> 40706f2543Smrg 41706f2543Smrgvoid 42706f2543SmrgXkbDDXKeybdCtrlProc(DeviceIntPtr dev,KeybdCtrl *ctrl) 43706f2543Smrg{ 44706f2543Smrgint realRepeat; 45706f2543Smrg 46706f2543Smrg realRepeat= ctrl->autoRepeat; 47706f2543Smrg if ((dev->kbdfeed)&&(XkbDDXUsesSoftRepeat(dev))) 48706f2543Smrg ctrl->autoRepeat= 0; 49706f2543Smrg if (dev->key && dev->key->xkbInfo && dev->key->xkbInfo->kbdProc) 50706f2543Smrg (*dev->key->xkbInfo->kbdProc)(dev,ctrl); 51706f2543Smrg ctrl->autoRepeat= realRepeat; 52706f2543Smrg return; 53706f2543Smrg} 54706f2543Smrg 55706f2543Smrg 56706f2543Smrgint 57706f2543SmrgXkbDDXUsesSoftRepeat(DeviceIntPtr pXDev) 58706f2543Smrg{ 59706f2543Smrg return 1; 60706f2543Smrg} 61706f2543Smrg 62706f2543Smrgvoid 63706f2543SmrgXkbDDXChangeControls(DeviceIntPtr dev,XkbControlsPtr old,XkbControlsPtr new) 64706f2543Smrg{ 65706f2543Smrgunsigned changed, i; 66706f2543Smrgunsigned char *rep_old, *rep_new, *rep_fb; 67706f2543Smrg 68706f2543Smrg changed= new->enabled_ctrls^old->enabled_ctrls; 69706f2543Smrg for (rep_old = old->per_key_repeat, 70706f2543Smrg rep_new = new->per_key_repeat, 71706f2543Smrg rep_fb = dev->kbdfeed->ctrl.autoRepeats, 72706f2543Smrg i = 0; i < XkbPerKeyBitArraySize; i++) { 73706f2543Smrg if (rep_old[i] != rep_new[i]) { 74706f2543Smrg rep_fb[i] = rep_new[i]; 75706f2543Smrg changed &= XkbPerKeyRepeatMask; 76706f2543Smrg } 77706f2543Smrg } 78706f2543Smrg 79706f2543Smrg if (changed&XkbPerKeyRepeatMask) { 80706f2543Smrg if (dev->kbdfeed->CtrlProc) 81706f2543Smrg (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl); 82706f2543Smrg } 83706f2543Smrg return; 84706f2543Smrg} 85706f2543Smrg 86