Root/
Source at commit 1129 created 12 years 11 months ago. By meklort, Change options.o so that it reloads the system config as well. Also change it so that it uses that config for variables (NOTE: if the calue exists in chameleonConfig, it's used instead. | |
---|---|
1 | /*␊ |
2 | * @APPLE_LICENSE_HEADER_START@␊ |
3 | * ␊ |
4 | * Copyright (c) 1999-2009 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 | /******************************************************************************␊ |
24 | ␉event.h (PostScript side version)␊ |
25 | ␉␊ |
26 | ␉CONFIDENTIAL␊ |
27 | ␉Copyright (c) 1988 NeXT, Inc. as an unpublished work.␊ |
28 | ␉All Rights Reserved.␊ |
29 | ␊ |
30 | ␉Created Leo 01Mar88␊ |
31 | ␊ |
32 | ␉Modified:␊ |
33 | ␉04May88 Leo Final event types and record␊ |
34 | ␉22Aug88 Leo Change short -> int for window, add reserved␊ |
35 | ␉26May90 Ted Added NX_UNDIMMASK to correct triggering of UndoAutoDim␊ |
36 | ␉12Dec91 Mike Brought into sync with dpsclient/event.h, and fixed␊ |
37 | ␉␉ the #ifndef interlock with dpsclient/event.h that was␊ |
38 | ␉␉ broken during the Great Header Revision.␊ |
39 | ␊ |
40 | ␉The PostScript version of this file differs from the␊ |
41 | ␉Window Kit version in that the coordinates here are␊ |
42 | ␉ints instead of floats.␊ |
43 | ******************************************************************************/␊ |
44 | ␊ |
45 | #ifndef _DEV_EVENT_H␊ |
46 | #define _DEV_EVENT_H␊ |
47 | ␊ |
48 | #include <libkern/OSTypes.h>␊ |
49 | #include <IOKit/hidsystem/IOHIDTypes.h>␊ |
50 | ␊ |
51 | #ifdef EVENT_H␉␉/* Interlock with dpsclient/event.h */␊ |
52 | #if !defined(_NXSIZE_)␉/* Work around patch for old event.h in Phase 3 projs*/␊ |
53 | #define _NXSIZE_␉1␉/* NXCoord, NXPoint, NXSize decl seen */␊ |
54 | #define _NXSize_␉NXSize␊ |
55 | #endif /* _NXSIZE_ */␊ |
56 | #else /* EVENT_H */␉␉/* Haven't seen dpsclient/event.h, so define away */␊ |
57 | #define EVENT_H␊ |
58 | ␊ |
59 | #ifdef␉KERNEL␊ |
60 | #else␉/* KERNEL */␊ |
61 | ␊ |
62 | #if !defined(_NXSIZE_)␉/* Work around patch for old event.h in Phase 3 projs*/␊ |
63 | #define _NXSIZE_␉1␉/* NXCoord, NXPoint, NXSize decl seen */␊ |
64 | typedef float NXCoord;␊ |
65 | ␊ |
66 | typedef struct _NXPoint {␉/* point */␊ |
67 | NXCoord x, y;␊ |
68 | } NXPoint;␊ |
69 | ␊ |
70 | typedef struct _NXSize {␉/* size */␊ |
71 | NXCoord width, height;␊ |
72 | } NXSize;␊ |
73 | #define _NXSize_␉NXSize␉/* Correct usage in event_status_driver.h */␊ |
74 | #endif /* _NXSIZE_ */␊ |
75 | ␊ |
76 | #endif␉/* KERNEL */␊ |
77 | ␊ |
78 | /* Event types */␊ |
79 | ␊ |
80 | #define NX_NULLEVENT␉␉0␉/* internal use */␊ |
81 | ␊ |
82 | /* mouse events */␊ |
83 | ␊ |
84 | #define NX_LMOUSEDOWN␉␉1␉/* left mouse-down event */␊ |
85 | #define NX_LMOUSEUP␉␉2␉/* left mouse-up event */␊ |
86 | #define NX_RMOUSEDOWN␉␉3␉/* right mouse-down event */␊ |
87 | #define NX_RMOUSEUP␉␉4␉/* right mouse-up event */␊ |
88 | #define NX_MOUSEMOVED␉␉5␉/* mouse-moved event */␊ |
89 | #define NX_LMOUSEDRAGGED␉6␉/* left mouse-dragged event */␊ |
90 | #define NX_RMOUSEDRAGGED␉7␉/* right mouse-dragged event */␊ |
91 | #define NX_MOUSEENTERED␉␉8␉/* mouse-entered event */␊ |
92 | #define NX_MOUSEEXITED␉␉9␉/* mouse-exited event */␊ |
93 | ␊ |
94 | /* other mouse events␊ |
95 | *␊ |
96 | * event.data.mouse.buttonNumber should contain the ␊ |
97 | * button number (2-31) changing state.␊ |
98 | */␊ |
99 | #define NX_OMOUSEDOWN␉␉25␉/* other mouse-down event */␊ |
100 | #define NX_OMOUSEUP␉␉26␉/* other mouse-up event */␊ |
101 | #define NX_OMOUSEDRAGGED␉27␉/* other mouse-dragged event */␊ |
102 | ␊ |
103 | /* keyboard events */␊ |
104 | ␊ |
105 | #define NX_KEYDOWN␉␉10␉/* key-down event */␊ |
106 | #define NX_KEYUP␉␉11␉/* key-up event */␊ |
107 | #define NX_FLAGSCHANGED␉␉12␉/* flags-changed event */␊ |
108 | ␊ |
109 | /* composite events */␊ |
110 | ␊ |
111 | #define NX_KITDEFINED␉␉13␉/* application-kit-defined event */␊ |
112 | #define NX_SYSDEFINED␉␉14␉/* system-defined event */␊ |
113 | #define NX_APPDEFINED␉␉15␉/* application-defined event */␊ |
114 | /* There are additional DPS client defined events past this point. */␊ |
115 | ␊ |
116 | /* Scroll wheel events */␊ |
117 | ␊ |
118 | #define NX_SCROLLWHEELMOVED␉22␊ |
119 | ␊ |
120 | /* Zoom events */␊ |
121 | #define NX_ZOOM 28␊ |
122 | ␊ |
123 | /* tablet events */␊ |
124 | ␊ |
125 | #define NX_TABLETPOINTER␉23␉/* for non-mousing transducers */␊ |
126 | #define NX_TABLETPROXIMITY␉24 /* for non-mousing transducers */␊ |
127 | ␊ |
128 | /* event range */␊ |
129 | ␊ |
130 | #define NX_FIRSTEVENT␉␉0␊ |
131 | #define NX_LASTEVENT␉␉28␊ |
132 | #define NX_NUMPROCS␉␉(NX_LASTEVENT-NX_FIRSTEVENT+1)␊ |
133 | ␊ |
134 | /* Event masks */␊ |
135 | #define NX_NULLEVENTMASK (1 << NX_NULLEVENT) /* NULL event */␊ |
136 | #define NX_LMOUSEDOWNMASK (1 << NX_LMOUSEDOWN)␉/* left mouse-down */␊ |
137 | #define NX_LMOUSEUPMASK (1 << NX_LMOUSEUP) /* left mouse-up */␊ |
138 | #define NX_RMOUSEDOWNMASK (1 << NX_RMOUSEDOWN)␉/* right mouse-down */␊ |
139 | #define NX_RMOUSEUPMASK (1 << NX_RMOUSEUP) /* right mouse-up */␊ |
140 | #define NX_OMOUSEDOWNMASK (1 << NX_OMOUSEDOWN)␉/* other mouse-down */␊ |
141 | #define NX_OMOUSEUPMASK (1 << NX_OMOUSEUP) /* other mouse-up */␊ |
142 | #define NX_MOUSEMOVEDMASK (1 << NX_MOUSEMOVED)␉/* mouse-moved */␊ |
143 | #define NX_LMOUSEDRAGGEDMASK␉(1 << NX_LMOUSEDRAGGED)␉/* left-dragged */␊ |
144 | #define NX_RMOUSEDRAGGEDMASK␉(1 << NX_RMOUSEDRAGGED)␉/* right-dragged */␊ |
145 | #define NX_OMOUSEDRAGGEDMASK␉(1 << NX_OMOUSEDRAGGED)␉/* other-dragged */␊ |
146 | #define NX_MOUSEENTEREDMASK (1 << NX_MOUSEENTERED)␉/* mouse-entered */␊ |
147 | #define NX_MOUSEEXITEDMASK (1 << NX_MOUSEEXITED)␉/* mouse-exited */␊ |
148 | #define NX_KEYDOWNMASK (1 << NX_KEYDOWN) /* key-down */␊ |
149 | #define NX_KEYUPMASK (1 << NX_KEYUP) /* key-up */␊ |
150 | #define NX_FLAGSCHANGEDMASK (1 << NX_FLAGSCHANGED)␉/* flags-changed */␊ |
151 | #define NX_KITDEFINEDMASK (1 << NX_KITDEFINED)␉/* kit-defined */␊ |
152 | #define NX_SYSDEFINEDMASK (1 << NX_SYSDEFINED)␉/* system-defined */␊ |
153 | #define NX_APPDEFINEDMASK (1 << NX_APPDEFINED)␉/* app-defined */␊ |
154 | #define NX_SCROLLWHEELMOVEDMASK␉(1 << NX_SCROLLWHEELMOVED)␉/* scroll wheel moved */␊ |
155 | #define NX_ZOOMMASK (1 << NX_ZOOM) /* Zoom */␊ |
156 | #define NX_TABLETPOINTERMASK␉(1 << NX_TABLETPOINTER)␉/* tablet pointer moved */␊ |
157 | #define NX_TABLETPROXIMITYMASK␉(1 << NX_TABLETPROXIMITY)␉/* tablet pointer proximity */␊ |
158 | ␊ |
159 | #define EventCodeMask(type)␉(1 << (type))␊ |
160 | #define NX_ALLEVENTS␉␉-1␉/* Check for all events */␊ |
161 | ␊ |
162 | /* sub types for mouse and move events */␊ |
163 | ␊ |
164 | #define NX_SUBTYPE_DEFAULT␉␉␉␉␉0␊ |
165 | #define NX_SUBTYPE_TABLET_POINT␉␉␉␉1␊ |
166 | #define NX_SUBTYPE_TABLET_PROXIMITY␉␉␉2␊ |
167 | #define NX_SUBTYPE_MOUSE_TOUCH 3␊ |
168 | ␊ |
169 | /* sub types for system defined events */␊ |
170 | ␊ |
171 | #define NX_SUBTYPE_POWER_KEY␉␉␉␉1␊ |
172 | #define NX_SUBTYPE_AUX_MOUSE_BUTTONS␉␉7␊ |
173 | ␊ |
174 | /* ␊ |
175 | * NX_SUBTYPE_AUX_CONTROL_BUTTONS usage␊ |
176 | *␊ |
177 | * The incoming NXEvent for other mouse button down/up has event.type ␊ |
178 | * NX_SYSDEFINED and event.data.compound.subtype NX_SUBTYPE_AUX_MOUSE_BUTTONS.␊ |
179 | * Within the event.data.compound.misc.L[0] contains bits for all the buttons ␊ |
180 | * that have changed state, and event.data.compound.misc.L[1] contains the ␊ |
181 | * current button state as a bitmask, with 1 representing down, and 0␊ |
182 | * representing up. Bit 0 is the left button, bit one is the right button, ␊ |
183 | * bit 2 is the center button and so forth.␊ |
184 | */␊ |
185 | #define NX_SUBTYPE_AUX_CONTROL_BUTTONS␉␉8␊ |
186 | ␊ |
187 | #define NX_SUBTYPE_EJECT_KEY␉␉␉␉10␊ |
188 | #define NX_SUBTYPE_SLEEP_EVENT␉␉␉␉11␊ |
189 | #define NX_SUBTYPE_RESTART_EVENT␉␉␉12␊ |
190 | #define NX_SUBTYPE_SHUTDOWN_EVENT␉␉␉13␊ |
191 | ␊ |
192 | #define NX_SUBTYPE_STICKYKEYS_ON␉␉␉100␊ |
193 | #define NX_SUBTYPE_STICKYKEYS_OFF␉␉␉101␊ |
194 | #define NX_SUBTYPE_STICKYKEYS_SHIFT␉␉␉102␊ |
195 | #define NX_SUBTYPE_STICKYKEYS_CONTROL␉␉␉103␊ |
196 | #define NX_SUBTYPE_STICKYKEYS_ALTERNATE␉␉␉104␊ |
197 | #define NX_SUBTYPE_STICKYKEYS_COMMAND␉␉␉105␊ |
198 | #define NX_SUBTYPE_STICKYKEYS_RELEASE␉␉␉106␊ |
199 | #define NX_SUBTYPE_STICKYKEYS_TOGGLEMOUSEDRIVING␉107␊ |
200 | ␊ |
201 | // New stickykeys key events␊ |
202 | // These were created to send an event describing the ␊ |
203 | // different state of the modifiers␊ |
204 | #define NX_SUBTYPE_STICKYKEYS_SHIFT_DOWN␉␉110␊ |
205 | #define NX_SUBTYPE_STICKYKEYS_CONTROL_DOWN␉␉111␊ |
206 | #define NX_SUBTYPE_STICKYKEYS_ALTERNATE_DOWN␉␉112␊ |
207 | #define NX_SUBTYPE_STICKYKEYS_COMMAND_DOWN␉␉113␊ |
208 | #define NX_SUBTYPE_STICKYKEYS_FN_DOWN␉␉␉114␊ |
209 | ␊ |
210 | #define NX_SUBTYPE_STICKYKEYS_SHIFT_LOCK␉␉120␊ |
211 | #define NX_SUBTYPE_STICKYKEYS_CONTROL_LOCK␉␉121␊ |
212 | #define NX_SUBTYPE_STICKYKEYS_ALTERNATE_LOCK␉␉122␊ |
213 | #define NX_SUBTYPE_STICKYKEYS_COMMAND_LOCK␉␉123␊ |
214 | #define NX_SUBTYPE_STICKYKEYS_FN_LOCK␉␉␉124␊ |
215 | ␊ |
216 | #define NX_SUBTYPE_STICKYKEYS_SHIFT_UP␉␉␉130␊ |
217 | #define NX_SUBTYPE_STICKYKEYS_CONTROL_UP␉␉131␊ |
218 | #define NX_SUBTYPE_STICKYKEYS_ALTERNATE_UP␉␉132␊ |
219 | #define NX_SUBTYPE_STICKYKEYS_COMMAND_UP␉␉133␊ |
220 | #define NX_SUBTYPE_STICKYKEYS_FN_UP␉␉␉134␊ |
221 | ␊ |
222 | ␊ |
223 | ␊ |
224 | // SlowKeys ␊ |
225 | #define NX_SUBTYPE_SLOWKEYS_START␉␉␉200␊ |
226 | #define NX_SUBTYPE_SLOWKEYS_ABORT␉␉␉201␊ |
227 | #define NX_SUBTYPE_SLOWKEYS_END␉␉␉␉202␊ |
228 | ␊ |
229 | // HID Parameter Property Modified␊ |
230 | #define NX_SUBTYPE_HIDPARAMETER_MODIFIED␉␉210␊ |
231 | ␊ |
232 | /* Masks for the bits in event.flags */␊ |
233 | ␊ |
234 | /* device-independent */␊ |
235 | ␊ |
236 | #define␉NX_ALPHASHIFTMASK␉0x00010000␊ |
237 | #define␉NX_SHIFTMASK␉␉0x00020000␊ |
238 | #define␉NX_CONTROLMASK␉␉0x00040000␊ |
239 | #define␉NX_ALTERNATEMASK␉0x00080000␊ |
240 | #define␉NX_COMMANDMASK␉␉0x00100000␊ |
241 | #define␉NX_NUMERICPADMASK␉0x00200000␊ |
242 | #define␉NX_HELPMASK␉␉0x00400000␊ |
243 | #define␉NX_SECONDARYFNMASK␉0x00800000␊ |
244 | ␊ |
245 | /* device-dependent (really?) */␊ |
246 | ␊ |
247 | #define␉NX_DEVICELCTLKEYMASK␉0x00000001␊ |
248 | #define␉NX_DEVICELSHIFTKEYMASK␉0x00000002␊ |
249 | #define␉NX_DEVICERSHIFTKEYMASK␉0x00000004␊ |
250 | #define␉NX_DEVICELCMDKEYMASK␉0x00000008␊ |
251 | #define␉NX_DEVICERCMDKEYMASK␉0x00000010␊ |
252 | #define␉NX_DEVICELALTKEYMASK␉0x00000020␊ |
253 | #define␉NX_DEVICERALTKEYMASK␉0x00000040␊ |
254 | #define NX_DEVICERCTLKEYMASK␉0x00002000␊ |
255 | ␊ |
256 | /* ␊ |
257 | * Additional reserved bits in event.flags␊ |
258 | */␊ |
259 | ␊ |
260 | #define NX_STYLUSPROXIMITYMASK␉0x00000080␉/* deprecated */␊ |
261 | #define NX_NONCOALSESCEDMASK␉0x00000100␊ |
262 | ␊ |
263 | /* click state values␊ |
264 | * If you have the following events in close succession, the click␊ |
265 | * field has the indicated value:␊ |
266 | *␉␊ |
267 | * Event␉Click Value␉Comments␊ |
268 | * mouse-down␉1␉␉Not part of any click yet␊ |
269 | * mouse-up␉1␉␉Aha! A click!␊ |
270 | * mouse-down␉2␉␉Doing a double-click␊ |
271 | * mouse-up␉2␉␉It's finished␊ |
272 | * mouse-down␉3␉␉A triple␊ |
273 | * mouse-up␉3␊ |
274 | */␊ |
275 | ␊ |
276 | /* Values for the character set in event.data.key.charSet */␊ |
277 | ␊ |
278 | #define␉NX_ASCIISET␉␉0␊ |
279 | #define NX_SYMBOLSET␉␉1␊ |
280 | #define␉NX_DINGBATSSET␉␉2␊ |
281 | ␊ |
282 | /* tablet button masks␊ |
283 | * Mask bits for the tablet barrel buttons placed in tablet.buttons.␊ |
284 | * The buttons field uses adopts the following convention:␊ |
285 | *␊ |
286 | * Bit Comments␊ |
287 | * 0 Left Mouse Button ( kHIDUsage_Button_1 )␊ |
288 | * 1 Right Mouse Button ( kHIDUsage_Button_2 )␊ |
289 | * 2 Middle Mouse Button ( kHIDUsage_Button_3 )␊ |
290 | * 3 4th Mouse Button ( kHIDUsage_Button_4 )␊ |
291 | * ...␊ |
292 | * 15 15th Mouse Button␊ |
293 | *␊ |
294 | * For your convenience, the following mask bits have been defined␊ |
295 | * for tablet specific application:␊ |
296 | */␊ |
297 | ␊ |
298 | #define NX_TABLET_BUTTON_PENTIPMASK 0x0001␊ |
299 | #define NX_TABLET_BUTTON_PENLOWERSIDEMASK 0x0002␊ |
300 | #define NX_TABLET_BUTTON_PENUPPERSIDEMASK 0x0004␊ |
301 | ␊ |
302 | ␊ |
303 | /* tablet capability masks␊ |
304 | * Mask bits for the tablet capabilities field. Use these ␊ |
305 | * masks with the capabilities field of a proximity event to ␊ |
306 | * determine what fields in a Tablet Event are valid for this ␊ |
307 | * device.␊ |
308 | */␊ |
309 | #define NX_TABLET_CAPABILITY_DEVICEIDMASK 0x0001␊ |
310 | #define NX_TABLET_CAPABILITY_ABSXMASK 0x0002␊ |
311 | #define NX_TABLET_CAPABILITY_ABSYMASK 0x0004␊ |
312 | #define NX_TABLET_CAPABILITY_VENDOR1MASK 0x0008␊ |
313 | #define NX_TABLET_CAPABILITY_VENDOR2MASK 0x0010␊ |
314 | #define NX_TABLET_CAPABILITY_VENDOR3MASK 0x0020␊ |
315 | #define NX_TABLET_CAPABILITY_BUTTONSMASK 0x0040␊ |
316 | #define NX_TABLET_CAPABILITY_TILTXMASK 0x0080␊ |
317 | #define NX_TABLET_CAPABILITY_TILTYMASK 0x0100␊ |
318 | #define NX_TABLET_CAPABILITY_ABSZMASK 0x0200␊ |
319 | #define NX_TABLET_CAPABILITY_PRESSUREMASK 0x0400␊ |
320 | #define NX_TABLET_CAPABILITY_TANGENTIALPRESSUREMASK 0x0800␊ |
321 | #define NX_TABLET_CAPABILITY_ORIENTINFOMASK 0x1000␊ |
322 | #define NX_TABLET_CAPABILITY_ROTATIONMASK 0x2000␊ |
323 | ␊ |
324 | /* proximity pointer types␊ |
325 | * Value that describes the type of pointing device placed in␊ |
326 | * proximity.pointerType.␊ |
327 | */␊ |
328 | ␊ |
329 | #define NX_TABLET_POINTER_UNKNOWN 0␊ |
330 | #define NX_TABLET_POINTER_PEN 1␊ |
331 | #define NX_TABLET_POINTER_CURSOR 2␊ |
332 | #define NX_TABLET_POINTER_ERASER 3␊ |
333 | ␊ |
334 | /* TabletPointData type: defines the tablet data for points included␊ |
335 | * in mouse events created by a tablet driver.␊ |
336 | */␊ |
337 | ␊ |
338 | typedef struct _NXTabletPointData {␊ |
339 | ␉SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */␊ |
340 | SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */␊ |
341 | ␉SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */␊ |
342 | UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */␊ |
343 | UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */␊ |
344 | struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */␊ |
345 | SInt16 x; /* scaled tilt x value */␊ |
346 | SInt16 y; /* scaled tilt y value */␊ |
347 | ␉} tilt;␊ |
348 | ␉UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */␊ |
349 | ␉SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */␊ |
350 | ␉UInt16 deviceID; /* system-assigned unique device ID */␊ |
351 | ␉SInt16 vendor1; /* vendor-defined signed 16-bit integer */␊ |
352 | ␉SInt16 vendor2; /* vendor-defined signed 16-bit integer */␊ |
353 | ␉SInt16 vendor3; /* vendor-defined signed 16-bit integer */␊ |
354 | } NXTabletPointData, *NXTabletPointDataPtr;␊ |
355 | ␊ |
356 | /* TabletProximityData type: defines the tablet data for proximity␊ |
357 | * events included in mouse events created by a tablet driver.␊ |
358 | */␊ |
359 | ␊ |
360 | typedef struct _NXTabletProximityData {␊ |
361 | UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */␊ |
362 | ␉UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */␊ |
363 | ␉UInt16 pointerID; /* vendor-defined ID of the specific pointing device */␊ |
364 | ␉UInt16 deviceID; /* system-assigned unique device ID */␊ |
365 | ␉UInt16 systemTabletID; /* system-assigned unique tablet ID */␊ |
366 | ␉UInt16 vendorPointerType; /* vendor-defined pointer type */␊ |
367 | ␉UInt32 pointerSerialNumber; /* vendor-defined serial number */␊ |
368 | ␉UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */␊ |
369 | ␉UInt32 capabilityMask; /* capabilities mask of the device */␊ |
370 | ␉UInt8 pointerType; /* type of pointing device */␊ |
371 | ␉UInt8 enterProximity; /* non-zero = entering; zero = leaving */␊ |
372 | ␉SInt16 reserved1;␊ |
373 | } NXTabletProximityData, *NXTabletProximityDataPtr;␊ |
374 | ␊ |
375 | /* EventData type: defines the data field of an event */␊ |
376 | ␊ |
377 | typedef␉union {␊ |
378 | struct { /* For mouse-down and mouse-up events */␊ |
379 | UInt8 subx; /* sub-pixel position for x */␊ |
380 | UInt8 suby; /* sub-pixel position for y */␊ |
381 | SInt16 eventNum; /* unique identifier for this button */␊ |
382 | SInt32 click; /* click state of this event */␊ |
383 | UInt8 pressure; /* pressure value: 0=none, 255=full */␊ |
384 | UInt8 buttonNumber;/* button generating other button event (0-31) */␊ |
385 | UInt8 subType;␊ |
386 | UInt8 reserved2;␊ |
387 | SInt32 reserved3;␊ |
388 | union {␊ |
389 | NXTabletPointData point; /* tablet point data */␊ |
390 | NXTabletProximityData proximity; /* tablet proximity data */␊ |
391 | } tablet;␊ |
392 | } mouse;␊ |
393 | struct {␊ |
394 | SInt32 dx;␊ |
395 | SInt32 dy;␊ |
396 | UInt8 subx;␊ |
397 | UInt8 suby;␊ |
398 | UInt8 subType;␊ |
399 | UInt8 reserved1;␊ |
400 | SInt32 reserved2;␊ |
401 | union {␊ |
402 | NXTabletPointData point; /* tablet point data */␊ |
403 | NXTabletProximityData proximity; /* tablet proximity data */␊ |
404 | } tablet;␊ |
405 | } mouseMove;␊ |
406 | struct { /* For key-down and key-up events */␊ |
407 | UInt16 origCharSet; /* unmodified character set code */␊ |
408 | SInt16 repeat; /* for key-down: nonzero if really a repeat */␊ |
409 | UInt16 charSet; /* character set code */␊ |
410 | UInt16 charCode; /* character code in that set */␊ |
411 | UInt16 keyCode; /* device-dependent key number */␊ |
412 | UInt16 origCharCode; /* unmodified character code */␊ |
413 | SInt32 reserved1;␊ |
414 | UInt32 keyboardType;␊ |
415 | SInt32 reserved2;␊ |
416 | SInt32 reserved3;␊ |
417 | SInt32 reserved4;␊ |
418 | SInt32 reserved5[4];␊ |
419 | } key;␊ |
420 | struct { /* For mouse-entered and mouse-exited events */␊ |
421 | SInt16 reserved;␊ |
422 | SInt16 eventNum; /* unique identifier from mouse down event */␊ |
423 | SInt32 trackingNum; /* unique identifier from settrackingrect */␊ |
424 | SInt32 userData; /* uninterpreted integer from settrackingrect */␊ |
425 | SInt32 reserved1;␊ |
426 | SInt32 reserved2;␊ |
427 | SInt32 reserved3;␊ |
428 | SInt32 reserved4;␊ |
429 | SInt32 reserved5;␊ |
430 | SInt32 reserved6[4];␊ |
431 | } tracking;␊ |
432 | struct {␊ |
433 | SInt16 deltaAxis1;␊ |
434 | SInt16 deltaAxis2;␊ |
435 | SInt16 deltaAxis3;␊ |
436 | SInt16 reserved1;␊ |
437 | SInt32 fixedDeltaAxis1;␊ |
438 | SInt32 fixedDeltaAxis2;␊ |
439 | SInt32 fixedDeltaAxis3;␊ |
440 | SInt32 pointDeltaAxis1;␊ |
441 | SInt32 pointDeltaAxis2;␊ |
442 | SInt32 pointDeltaAxis3;␊ |
443 | SInt32 reserved8[4];␊ |
444 | } scrollWheel, zoom;␊ |
445 | struct { /* For window-changed, sys-defined, and app-defined events */␊ |
446 | SInt16 reserved;␊ |
447 | SInt16 subType; /* event subtype for compound events */␊ |
448 | union {␊ |
449 | float F[11]; /* for use in compound events */␊ |
450 | SInt32 L[11]; /* for use in compound events */␊ |
451 | SInt16 S[22]; /* for use in compound events */␊ |
452 | char C[44]; /* for use in compound events */␊ |
453 | } misc;␊ |
454 | } compound;␊ |
455 | struct {␊ |
456 | SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */␊ |
457 | SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */␊ |
458 | SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */␊ |
459 | UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */␊ |
460 | UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */␊ |
461 | struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */␊ |
462 | SInt16 x; /* scaled tilt x value */␊ |
463 | SInt16 y; /* scaled tilt y value */␊ |
464 | } tilt;␊ |
465 | UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */␊ |
466 | SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */␊ |
467 | UInt16 deviceID; /* system-assigned unique device ID */␊ |
468 | SInt16 vendor1; /* vendor-defined signed 16-bit integer */␊ |
469 | SInt16 vendor2; /* vendor-defined signed 16-bit integer */␊ |
470 | SInt16 vendor3; /* vendor-defined signed 16-bit integer */␊ |
471 | SInt32 reserved[4];␊ |
472 | } tablet;␊ |
473 | struct {␊ |
474 | UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */␊ |
475 | UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */␊ |
476 | UInt16 pointerID; /* vendor-defined ID of the specific pointing device */␊ |
477 | UInt16 deviceID; /* system-assigned unique device ID */␊ |
478 | UInt16 systemTabletID; /* system-assigned unique tablet ID */␊ |
479 | UInt16 vendorPointerType; /* vendor-defined pointer type */␊ |
480 | UInt32 pointerSerialNumber; /* vendor-defined serial number */␊ |
481 | UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */␊ |
482 | UInt32 capabilityMask; /* capabilities mask of the device */␊ |
483 | UInt8 pointerType; /* type of pointing device */␊ |
484 | UInt8 enterProximity; /* non-zero = entering; zero = leaving */␊ |
485 | SInt16 reserved1;␊ |
486 | SInt32 reserved2[4];␊ |
487 | } proximity;␊ |
488 | } NXEventData;␊ |
489 | ␊ |
490 | /* The current version number of the NXEventData structure. */␊ |
491 | ␊ |
492 | #define kNXEventDataVersion␉␉2␊ |
493 | ␊ |
494 | /* Finally! The event record! */␊ |
495 | #ifndef __ppc__␊ |
496 | typedef struct _NXEvent {␊ |
497 | ␉SInt32 type;␉␉/* An event type from above */␊ |
498 | struct {␊ |
499 | SInt32␉x, y;␉␉␉␉␉/* Base coordinates in window, */␊ |
500 | } ␉␉␉␉␉location;␉/* from bottom left */␊ |
501 | UInt64 time __attribute__ ((packed));␉␉/* time since launch */␊ |
502 | SInt32 flags;␉␉/* key state flags */␊ |
503 | UInt32 window;␉␉/* window number of assigned window */␊ |
504 | UInt64 service_id __attribute__ ((packed)); /* service id */␊ |
505 | SInt32 ext_pid; /* external pid */␊ |
506 | NXEventData␉␉␉data;␉␉/* type-dependent data */␊ |
507 | } NXEvent, *NXEventPtr;␊ |
508 | ␊ |
509 | #else␊ |
510 | ␊ |
511 | typedef struct _NXEvent {␊ |
512 | ␉SInt32 type;␉␉/* An event type from above */␊ |
513 | struct {␊ |
514 | SInt32␉x, y;␉␉␉␉␉/* Base coordinates in window, */␊ |
515 | } ␉␉␉␉␉location;␉/* from bottom left */␊ |
516 | UInt64 time __attribute__ ((packed));␉␉/* time since launch */␊ |
517 | SInt32 flags;␉␉/* key state flags */␊ |
518 | UInt32 window;␉␉/* window number of assigned window */␊ |
519 | NXEventData␉␉␉data;␉␉/* type-dependent data */␊ |
520 | UInt64 service_id __attribute__ ((packed)); /* service id */␊ |
521 | SInt32 ext_pid; /* external pid */␊ |
522 | } NXEvent, *NXEventPtr;␊ |
523 | #endif␊ |
524 | ␊ |
525 | /* The current version number of the NXEvent structure. */␊ |
526 | ␊ |
527 | #define kNXEventVersion␉␉2␊ |
528 | ␊ |
529 | /* How to pick window(s) for event (for PostEvent) */␊ |
530 | #define NX_NOWINDOW␉␉-1␊ |
531 | #define NX_BYTYPE␉␉0␊ |
532 | #define NX_BROADCAST␉␉1␊ |
533 | #define NX_TOPWINDOW␉␉2␊ |
534 | #define NX_FIRSTWINDOW␉␉3␊ |
535 | #define NX_MOUSEWINDOW␉␉4␊ |
536 | #define NX_NEXTWINDOW␉␉5␊ |
537 | #define NX_LASTLEFT␉␉6␊ |
538 | #define NX_LASTRIGHT␉␉7␊ |
539 | #define NX_LASTKEY␉␉8␊ |
540 | #define NX_EXPLICIT␉␉9␊ |
541 | #define NX_TRANSMIT␉␉10␊ |
542 | #define NX_BYPSCONTEXT␉␉11␊ |
543 | ␊ |
544 | #endif /* EVENT_H */␉/* End of defs common with dpsclient/event.h */␊ |
545 | ␊ |
546 | /* Mask of events that cause screen to undim */␊ |
547 | ␊ |
548 | #define NX_UNDIMMASK␉␉(NX_KEYDOWNMASK | NX_KEYUPMASK | \␊ |
549 | ␉␉␉␉ NX_LMOUSEDOWNMASK | NX_LMOUSEUPMASK | \␊ |
550 | ␉␉␉␉ NX_RMOUSEDOWNMASK | NX_RMOUSEUPMASK | \␊ |
551 | ␉␉␉␉ NX_MOUSEMOVEDMASK | NX_FLAGSCHANGEDMASK | \␊ |
552 | ␉␉␉␉ NX_MOUSEENTEREDMASK | NX_MOUSEEXITEDMASK | \␊ |
553 | ␉␉␉␉ NX_LMOUSEDRAGGEDMASK | NX_RMOUSEDRAGGEDMASK | \␊ |
554 | NX_SCROLLWHEELMOVEDMASK | NX_TABLETPOINTERMASK | \␊ |
555 | NX_TABLETPROXIMITYMASK | NX_NULLEVENTMASK)␊ |
556 | ␊ |
557 | #endif /* !_DEV_EVENT_H */␊ |
558 | ␊ |
559 |