Root/
Source at commit 1166 created 13 years 10 days ago. By meklort, Fixed recent Makefile changes. Please do not use /Users/evan/SourceCode/tmp/chameleon/trunk or VPATH. the *only* time you should use /Users/evan/SourceCode/tmp/chameleon/trunk is when setting the SRCROOT variable. Also note that very soon make pkg is going to be removed. The pkg build script in trunk is very out of date. Instead please use the package maker at http://forge.voodooprojects.org/p/chameleonApplications/. Once this is ready for trunk it will be merged. | |
---|---|
1 | /*␊ |
2 | * @APPLE_LICENSE_HEADER_START@␊ |
3 | * ␊ |
4 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. Please obtain a copy of the License at␊ |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this␊ |
11 | * file.␊ |
12 | * ␊ |
13 | * The Original Code and all software distributed under the License are␊ |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
18 | * Please see the License for the specific language governing rights and␊ |
19 | * limitations under the License.␊ |
20 | * ␊ |
21 | * @APPLE_LICENSE_HEADER_END@␊ |
22 | */␊ |
23 | /* ␉Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. ␊ |
24 | *␊ |
25 | *␉ev_keymap.h␊ |
26 | *␉Defines the structure used for parsing keymappings. These structures␊ |
27 | *␉and definitions are used by event sources in the kernel and by␊ |
28 | *␉applications and utilities which manipulate keymaps.␊ |
29 | *␉␊ |
30 | * HISTORY␊ |
31 | * 02-Jun-1992 Mike Paquette at NeXT␊ |
32 | * Created. ␊ |
33 | */␊ |
34 | ␊ |
35 | #ifndef _DEV_EV_KEYMAP_H␊ |
36 | #define _DEV_EV_KEYMAP_H␊ |
37 | ␊ |
38 | #define␉NX_NUMKEYCODES␉256␉/* Highest key code is 0xff. ADB used to use 0x80 for keydown state, but who the heck uses adb anymore. */␊ |
39 | #define NX_NUMSEQUENCES␉128␉/* Maximum possible number of sequences */␊ |
40 | #define␉NX_NUMMODIFIERS␉16␉/* Maximum number of modifier bits */␊ |
41 | #define␉NX_BYTE_CODES␉0␉/* If first short 0, all are bytes (else shorts) */␊ |
42 | ␊ |
43 | #define␉NX_WHICHMODMASK␉0x0f ␉/* bits out of keyBits for bucky bits */␊ |
44 | #define␉NX_MODMASK␉0x10␉/* Bit out of keyBits indicates modifier bit */␊ |
45 | #define␉NX_CHARGENMASK␉0x20␉/* bit out of keyBits for char gen */␊ |
46 | #define␉NX_SPECIALKEYMASK 0x40␉/* bit out of keyBits for specialty key */␊ |
47 | #define␉NX_KEYSTATEMASK␉0x80␉/* OBSOLETE - DO NOT USE IN NEW DESIGNS */␊ |
48 | ␊ |
49 | /*␊ |
50 | * Special keys currently known to and understood by the system.␊ |
51 | * If new specialty keys are invented, extend this list as appropriate.␊ |
52 | * The presence of these keys in a particular implementation is not␊ |
53 | * guaranteed.␊ |
54 | */␊ |
55 | #define NX_NOSPECIALKEY␉␉␉0xFFFF␊ |
56 | #define NX_KEYTYPE_SOUND_UP␉␉0␊ |
57 | #define NX_KEYTYPE_SOUND_DOWN␉␉1␊ |
58 | #define NX_KEYTYPE_BRIGHTNESS_UP␉2␊ |
59 | #define NX_KEYTYPE_BRIGHTNESS_DOWN␉3␊ |
60 | #define NX_KEYTYPE_CAPS_LOCK␉␉4␊ |
61 | #define NX_KEYTYPE_HELP␉␉␉5␊ |
62 | #define NX_POWER_KEY␉␉␉6␊ |
63 | #define␉NX_KEYTYPE_MUTE␉␉␉7␊ |
64 | #define NX_UP_ARROW_KEY␉␉␉8␊ |
65 | #define NX_DOWN_ARROW_KEY␉␉9␊ |
66 | #define NX_KEYTYPE_NUM_LOCK␉␉10␊ |
67 | ␊ |
68 | #define NX_KEYTYPE_CONTRAST_UP␉␉11␊ |
69 | #define NX_KEYTYPE_CONTRAST_DOWN␉12␊ |
70 | #define NX_KEYTYPE_LAUNCH_PANEL␉␉13␊ |
71 | #define NX_KEYTYPE_EJECT␉␉14␊ |
72 | #define NX_KEYTYPE_VIDMIRROR␉␉15␊ |
73 | ␊ |
74 | #define NX_KEYTYPE_PLAY␉␉␉16␊ |
75 | #define NX_KEYTYPE_NEXT␉␉␉17␊ |
76 | #define NX_KEYTYPE_PREVIOUS␉␉18␊ |
77 | #define NX_KEYTYPE_FAST␉␉␉19␊ |
78 | #define NX_KEYTYPE_REWIND␉␉20␊ |
79 | ␊ |
80 | #define NX_KEYTYPE_ILLUMINATION_UP␉21␊ |
81 | #define NX_KEYTYPE_ILLUMINATION_DOWN␉22␊ |
82 | #define NX_KEYTYPE_ILLUMINATION_TOGGLE␉23␊ |
83 | ␊ |
84 | #define␉NX_NUMSPECIALKEYS␉␉24 /* Maximum number of special keys */␊ |
85 | #define NX_NUM_SCANNED_SPECIALKEYS␉24 /* First 24 special keys are */␊ |
86 | ␉␉␉␉␉ /* actively scanned in kernel */␊ |
87 | ␊ |
88 | /* Mask of special keys that are posted as events */␊ |
89 | ␊ |
90 | #define NX_SPECIALKEY_POST_MASK␉␉\␊ |
91 | ((1 << NX_KEYTYPE_SOUND_UP) | (1 << NX_KEYTYPE_SOUND_DOWN) | \␊ |
92 | (1 << NX_POWER_KEY) | (1 << NX_KEYTYPE_MUTE) | \␊ |
93 | (1 << NX_KEYTYPE_BRIGHTNESS_UP) | (1 << NX_KEYTYPE_BRIGHTNESS_DOWN) | \␊ |
94 | (1 << NX_KEYTYPE_CONTRAST_UP) | (1 << NX_KEYTYPE_CONTRAST_UP) | \␊ |
95 | (1 << NX_KEYTYPE_LAUNCH_PANEL) | (1 << NX_KEYTYPE_EJECT) | \␊ |
96 | (1 << NX_KEYTYPE_VIDMIRROR) | (1 << NX_KEYTYPE_PLAY) | \␊ |
97 | (1 << NX_KEYTYPE_NEXT) | (1 << NX_KEYTYPE_PREVIOUS) | \␊ |
98 | (1 << NX_KEYTYPE_FAST) | (1 << NX_KEYTYPE_REWIND) | \␊ |
99 | (1 << NX_KEYTYPE_ILLUMINATION_UP) | \␊ |
100 | (1 << NX_KEYTYPE_ILLUMINATION_DOWN) | \␊ |
101 | (1 << NX_KEYTYPE_ILLUMINATION_TOGGLE) | 0)␊ |
102 | ␊ |
103 | /* Modifier key indices into modDefs[] */␊ |
104 | #define NX_MODIFIERKEY_ALPHALOCK␉0␊ |
105 | #define NX_MODIFIERKEY_SHIFT␉␉1␊ |
106 | #define NX_MODIFIERKEY_CONTROL␉␉2␊ |
107 | #define NX_MODIFIERKEY_ALTERNATE␉3␊ |
108 | #define NX_MODIFIERKEY_COMMAND␉␉4␊ |
109 | #define NX_MODIFIERKEY_NUMERICPAD␉5␊ |
110 | #define NX_MODIFIERKEY_HELP␉␉6␊ |
111 | #define NX_MODIFIERKEY_SECONDARYFN ␉7␊ |
112 | #define NX_MODIFIERKEY_NUMLOCK␉␉8␊ |
113 | ␊ |
114 | /* support for right hand modifier */␊ |
115 | #define NX_MODIFIERKEY_RSHIFT␉␉9␊ |
116 | #define NX_MODIFIERKEY_RCONTROL␉␉10␊ |
117 | #define NX_MODIFIERKEY_RALTERNATE␉11␊ |
118 | #define NX_MODIFIERKEY_RCOMMAND␉␉12␊ |
119 | ␊ |
120 | ␊ |
121 | typedef struct _NXParsedKeyMapping_ {␊ |
122 | ␉/* If nonzero, all numbers are shorts; if zero, all numbers are bytes*/␊ |
123 | ␉short␉shorts;␊ |
124 | ␉␊ |
125 | ␉/*␊ |
126 | ␉ * For each keycode, low order bit says if the key␊ |
127 | ␉ * generates characters.␊ |
128 | ␉ * High order bit says if the key is assigned to a modifier bit.␊ |
129 | ␉ * The second to low order bit gives the current state of the key.␊ |
130 | ␉ */␊ |
131 | ␉char␉keyBits[NX_NUMKEYCODES];␊ |
132 | ␉␊ |
133 | ␉/* Bit number of highest numbered modifier bit */␊ |
134 | ␉int␉␉␉maxMod;␊ |
135 | ␉␊ |
136 | ␉/* Pointers to where the list of keys for each modifiers bit begins,␊ |
137 | ␉ * or NULL.␊ |
138 | ␉ */␊ |
139 | ␉unsigned char *modDefs[NX_NUMMODIFIERS];␊ |
140 | ␉␊ |
141 | ␉/* Key code of highest key deinfed to generate characters */␊ |
142 | ␉int␉␉␉numDefs;␊ |
143 | ␉␊ |
144 | ␉/* Pointer into the keyMapping where this key's definitions begin */␊ |
145 | ␉unsigned char *keyDefs[NX_NUMKEYCODES];␊ |
146 | ␉␊ |
147 | ␉/* number of sequence definitions */␊ |
148 | ␉int␉␉␉numSeqs;␊ |
149 | ␉␊ |
150 | ␉/* pointers to sequences */␊ |
151 | ␉unsigned char *seqDefs[NX_NUMSEQUENCES];␊ |
152 | ␉␊ |
153 | ␉/* Special key definitions */␊ |
154 | ␉int␉␉␉numSpecialKeys;␊ |
155 | ␉␊ |
156 | ␉/* Special key values, or 0xFFFF if none */␊ |
157 | ␉unsigned short specialKeys[NX_NUMSPECIALKEYS];␊ |
158 | ␉␊ |
159 | ␉/* Pointer to the original keymapping string */␉␊ |
160 | ␉const unsigned char *mapping;␊ |
161 | ␉␊ |
162 | ␉/* Length of the original string */␊ |
163 | ␉int␉mappingLen;␉␊ |
164 | } NXParsedKeyMapping;␊ |
165 | ␊ |
166 | #endif /* !_DEV_EV_KEYMAP_H */␊ |
167 |