1 dawes 3.4 /* $XConsortium: xf86XKB.c /main/4 1996/02/04 09:28:04 kaleb $ */
|
2 dawes 1.1 /************************************************************
3 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
4
5 Permission to use, copy, modify, and distribute this
6 software and its documentation for any purpose and without
7 fee is hereby granted, provided that the above copyright
8 notice appear in all copies and that both that copyright
9 notice and this permission notice appear in supporting
10 documentation, and that the name of Silicon Graphics not be
11 used in advertising or publicity pertaining to distribution
12 of the software without specific prior written permission.
13 Silicon Graphics makes no representation about the suitability
14 of this software for any purpose. It is provided "as is"
15 without any express or implied warranty.
16
17 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
18 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
20 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
21 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
22 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
23 dawes 1.1 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
24 THE USE OR PERFORMANCE OF THIS SOFTWARE.
25
26 ********************************************************/
27
28 #include <stdio.h>
29 #define NEED_EVENTS 1
30 #include <X11/X.h>
31 #include <X11/Xproto.h>
32 #include <X11/keysym.h>
33 #include "inputstr.h"
34 #include "scrnintstr.h"
35 #include "windowstr.h"
36 #include "XKBsrv.h"
37 #include "XI.h"
38
39 #include "compiler.h"
40
41 #include "xf86Procs.h"
42 #include "xf86_OSlib.h"
43 #include "xf86_Config.h"
44 dawes 1.1
45 #ifdef AMOEBA
46 #define LED_CAP IOP_LED_CAP
47 #define LED_NUM IOP_LED_NUM
48 #define LED_SCR IOP_LED_SCROLL
49 #endif
50
51 #ifdef MINIX
52 #define LED_CAP KBD_LEDS_CAPS
53 #define LED_NUM KBD_LEDS_NUM
54 #define LED_SCR KBD_LEDS_SCROLL
55 #endif
56
57 void
58 xf86InitXkb()
59 {
60 }
61
62 void
|
63 dawes 3.2 #if NeedFunctionPrototypes
64 XkbDDXUpdateIndicators(DeviceIntPtr pXDev,CARD32 new)
65 #else
|
66 dawes 3.0 XkbDDXUpdateIndicators(pXDev,new)
|
67 dawes 1.1 DeviceIntPtr pXDev;
68 CARD32 new;
|
69 dawes 3.2 #endif
|
70 dawes 1.1 {
|
71 dawes 3.0 CARD32 old;
|
72 dawes 1.1 #ifdef DEBUG
73 /* if (xkbDebugFlags)*/
74 ErrorF("XkbDDXUpdateIndicators(...,0x%x) -- XFree86 version\n",new);
75 #endif
76 #ifdef LED_CAP
77 old= new;
78 new= 0;
79 if (old&XLED1) new|= LED_CAP;
80 if (old&XLED2) new|= LED_NUM;
81 if (old&XLED3) new|= LED_SCR;
82 #endif
83 xf86SetKbdLeds(new);
84 return;
85 }
|
86 dawes 3.2
87 void
88 #if NeedFunctionPrototypes
89 XkbDDXUpdateDeviceIndicators( DeviceIntPtr dev,
90 XkbSrvLedInfoPtr sli,
91 CARD32 new)
92 #else
93 XkbDDXUpdateDeviceIndicators(dev,sli,new)
94 DeviceIntPtr dev;
95 XkbSrvLedInfoPtr sli;
96 CARD32 new;
|
97 dawes 3.0 #endif
|
98 dawes 3.2 {
99 if (sli->fb.kf==dev->kbdfeed)
100 XkbDDXUpdateIndicators(dev,new);
101 else if (sli->class==KbdFeedbackClass) {
102 KbdFeedbackPtr kf;
103 kf= sli->fb.kf;
104 if (kf && kf->CtrlProc) {
105 (*kf->CtrlProc)(dev,&kf->ctrl);
106 }
107 }
108 else if (sli->class==LedFeedbackClass) {
109 LedFeedbackPtr lf;
110 lf= sli->fb.lf;
111 if (lf && lf->CtrlProc) {
112 (*lf->CtrlProc)(dev,&lf->ctrl);
113 }
114 }
115 return;
116 }
|