1/*
2 *
3 * @APPLE_LICENSE_HEADER_START@
4 *
5 * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
6 *
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. Please obtain a copy of the License at
11 * http://www.opensource.apple.com/apsl/ and read it before using this
12 * file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
19 * Please see the License for the specific language governing rights and
20 * limitations under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25#ifndef _IOKIT_HID_IOHIDEVENTTYPES_H
26#define _IOKIT_HID_IOHIDEVENTTYPES_H /* { */
27
28#include <TargetConditionals.h>
29#include <IOKit/IOTypes.h>
30
31#define IOHIDEventTypeMask(type) (1LL<<type)
32#define IOHIDEventFieldBase(type) (type << 16)
33/*!
34    @typedef IOHIDEventType
35    @abstract The type of event represented by an IOHIDEventRef.
36    @discussion It is possible that a single IOHIDEventRef can conform to
37    multiple event types through the use of sub events.  For futher information
38    as to how to determinte the type of event please reference IOHIDEventGetType
39    and IOHIDEventConformsTo.
40    @constant kIOHIDEventTypeNULL
41    @constant kIOHIDEventTypeVendorDefined
42    @constant kIOHIDEventTypeButton
43    @constant kIOHIDEventTypeKeyboard
44    @constant kIOHIDEventTypeTranslation
45    @constant kIOHIDEventTypeRotation
46    @constant kIOHIDEventTypeScroll
47    @constant kIOHIDEventTypeScale
48    @constant kIOHIDEventTypeZoom
49    @constant kIOHIDEventTypeVelocity
50    @constant kIOHIDEventTypeOrientation
51    @constant kIOHIDEventTypeDigitizer
52    @constant kIOHIDEventTypeAmbientLightSensor
53    @constant kIOHIDEventTypeAccelerometer
54    @constant kIOHIDEventTypeProximity
55    @constant kIOHIDEventTypeTemperature
56    @constant kIOHIDEventTypeNavigationSwipe
57    @constant kIOHIDEventTypePointer
58    @constant kIOHIDEventTypeProgress
59    @constant kIOHIDEventTypeMultiAxisPointer
60    @constant kIOHIDEventTypeGyro
61    @constant kIOHIDEventTypeCompass
62    @constant kIOHIDEventTypeZoomToggle
63    @constant kIOHIDEventTypeDockSwipe
64    @constant kIOHIDEventTypeSymbolicHotKey
65    @constant kIOHIDEventTypePower
66    @constant kIOHIDEventTypeLED
67    @constant kIOHIDEventTypeFluidTouchGesture
68    @constant kIOHIDEventTypeBoundaryScroll
69    @constant kIOHIDEventTypeBiometric
70    @constant kIOHIDEventTypeSwipe DEPRECATED
71    @constant kIOHIDEventTypeMouse DEPRECATED
72
73*/
74enum {
75    kIOHIDEventTypeNULL,                    // 0
76    kIOHIDEventTypeVendorDefined,
77    kIOHIDEventTypeButton,
78    kIOHIDEventTypeKeyboard,
79    kIOHIDEventTypeTranslation,
80    kIOHIDEventTypeRotation,                // 5
81    kIOHIDEventTypeScroll,
82    kIOHIDEventTypeScale,
83    kIOHIDEventTypeZoom,
84    kIOHIDEventTypeVelocity,
85    kIOHIDEventTypeOrientation,             // 10
86    kIOHIDEventTypeDigitizer,
87    kIOHIDEventTypeAmbientLightSensor,
88    kIOHIDEventTypeAccelerometer,
89    kIOHIDEventTypeProximity,
90    kIOHIDEventTypeTemperature,             // 15
91    kIOHIDEventTypeNavigationSwipe,
92    kIOHIDEventTypePointer,
93    kIOHIDEventTypeProgress,
94    kIOHIDEventTypeMultiAxisPointer,
95    kIOHIDEventTypeGyro,                    // 20
96    kIOHIDEventTypeCompass,
97    kIOHIDEventTypeZoomToggle,
98    kIOHIDEventTypeDockSwipe,               // just like kIOHIDEventTypeNavigationSwipe, but intended for consumption by Dock
99    kIOHIDEventTypeSymbolicHotKey,
100    kIOHIDEventTypePower,                   // 25
101    kIOHIDEventTypeLED,
102    kIOHIDEventTypeFluidTouchGesture,       // This will eventually superseed Navagation and Dock swipes
103    kIOHIDEventTypeBoundaryScroll,
104    kIOHIDEventTypeBiometric,
105    kIOHIDEventTypeUnicode,                 // 30
106    kIOHIDEventTypeAtmosphericPressure,
107    kIOHIDEventTypeUndefined,
108    kIOHIDEventTypeCount, // This should always be last
109
110
111    // DEPRECATED:
112    kIOHIDEventTypeSwipe = kIOHIDEventTypeNavigationSwipe,
113    kIOHIDEventTypeMouse = kIOHIDEventTypePointer
114};
115typedef uint32_t IOHIDEventType;
116
117/*
118    @typedef IOHIDEventField
119    @abstract Keys used to set and get individual event fields.
120*/
121enum {
122    kIOHIDEventFieldIsRelative = IOHIDEventFieldBase(kIOHIDEventTypeNULL),
123    kIOHIDEventFieldIsCollection,
124    kIOHIDEventFieldIsPixelUnits,
125    kIOHIDEventFieldIsCenterOrigin,
126    kIOHIDEventFieldIsBuiltIn
127};
128
129enum {
130    kIOHIDEventFieldVendorDefinedUsagePage = IOHIDEventFieldBase(kIOHIDEventTypeVendorDefined),
131    kIOHIDEventFieldVendorDefinedUsage,
132    kIOHIDEventFieldVendorDefinedVersion,
133    kIOHIDEventFieldVendorDefinedDataLength,
134    kIOHIDEventFieldVendorDefinedData
135};
136
137enum  {
138    kIOHIDEventFieldButtonMask = IOHIDEventFieldBase(kIOHIDEventTypeButton),
139    kIOHIDEventFieldButtonNumber,
140    kIOHIDEventFieldButtonClickCount,
141    kIOHIDEventFieldButtonPressure,
142    kIOHIDEventFieldButtonState
143};
144
145enum {
146    kIOHIDEventFieldTranslationX = IOHIDEventFieldBase(kIOHIDEventTypeTranslation),
147    kIOHIDEventFieldTranslationY,
148    kIOHIDEventFieldTranslationZ
149};
150
151enum {
152    kIOHIDEventFieldRotationX = IOHIDEventFieldBase(kIOHIDEventTypeRotation),
153    kIOHIDEventFieldRotationY,
154    kIOHIDEventFieldRotationZ
155};
156
157enum {
158    kIOHIDEventFieldScrollX = IOHIDEventFieldBase(kIOHIDEventTypeScroll),
159    kIOHIDEventFieldScrollY,
160    kIOHIDEventFieldScrollZ,
161    kIOHIDEventFieldScrollIsPixels
162};
163
164enum {
165    kIOHIDEventFieldScaleX = IOHIDEventFieldBase(kIOHIDEventTypeScale),
166    kIOHIDEventFieldScaleY,
167    kIOHIDEventFieldScaleZ
168};
169
170enum {
171    kIOHIDEventFieldVelocityX = IOHIDEventFieldBase(kIOHIDEventTypeVelocity),
172    kIOHIDEventFieldVelocityY,
173    kIOHIDEventFieldVelocityZ
174};
175
176enum {
177    kIOHIDEventFieldPointerX = IOHIDEventFieldBase(kIOHIDEventTypePointer),
178    kIOHIDEventFieldPointerY,
179    kIOHIDEventFieldPointerZ,
180    kIOHIDEventFieldPointerButtonMask,
181    kIOHIDEventFieldPointerButtonNumber     = kIOHIDEventFieldButtonNumber,
182    kIOHIDEventFieldPointerButtonClickCount = kIOHIDEventFieldButtonClickCount,
183    kIOHIDEventFieldPointerButtonPressure   = kIOHIDEventFieldButtonPressure
184};
185
186enum {
187    kIOHIDEventFieldMultiAxisPointerX                   = IOHIDEventFieldBase(kIOHIDEventTypeMultiAxisPointer),
188    kIOHIDEventFieldMultiAxisPointerY,
189    kIOHIDEventFieldMultiAxisPointerZ,
190    kIOHIDEventFieldMultiAxisPointerRx,
191    kIOHIDEventFieldMultiAxisPointerRy,
192    kIOHIDEventFieldMultiAxisPointerRz,
193    kIOHIDEventFieldMultiAxisPointerButtonMask,
194    kIOHIDEventFieldMultiAxisPointerButtonNumber        = kIOHIDEventFieldButtonNumber,
195    kIOHIDEventFieldMultiAxisPointerButtonClickCount    = kIOHIDEventFieldButtonClickCount,
196    kIOHIDEventFieldMultiAxisPointerButtonPressure      = kIOHIDEventFieldButtonPressure
197};
198
199/* DEPRECATED: use pointer field */
200enum {
201    kIOHIDEventFieldMouseX          = kIOHIDEventFieldPointerX,
202    kIOHIDEventFieldMouseY          = kIOHIDEventFieldPointerY,
203    kIOHIDEventFieldMouseZ          = kIOHIDEventFieldPointerZ,
204    kIOHIDEventFieldMouseButtonMask = kIOHIDEventFieldPointerButtonMask,
205    kIOHIDEventFieldMouseNumber     = kIOHIDEventFieldPointerButtonNumber,
206    kIOHIDEventFieldMouseClickCount = kIOHIDEventFieldPointerButtonClickCount,
207    kIOHIDEventFieldMousePressure   = kIOHIDEventFieldPointerButtonPressure
208};
209
210
211/*!
212 @typedef IOHIDMotionType
213 @abstract Type of Motion event triggered.
214 @discussion
215 @constant kIOHIDMotionTypeNormal
216 @constant kIOHIDMotionTypeShake
217 */
218enum {
219    kIOHIDMotionTypeNormal   = 0,
220    kIOHIDMotionTypeShake    = 1,
221    kIOHIDMotionTypePath     = 2
222};
223typedef uint32_t IOHIDMotionType;
224
225/*!
226 @typedef IOHIDMotionPath
227 @abstract Type of Motion Path event triggered.
228 @discussion
229 @constant IOHIDMotionPathStart
230 @constant IOHIDMotionPathEnd
231 */
232enum {
233    kIOHIDMotionPathStart   = 0,
234    kIOHIDMotionPathEnd     = 1,
235};
236typedef uint32_t IOHIDMotionPath;
237
238// Legacy
239enum {
240    kIOHIDAccelerometerTypeNormal   = kIOHIDMotionTypeNormal,
241    kIOHIDAccelerometerTypeShake    = kIOHIDMotionTypeShake,
242    kIOHIDGyroTypeNormal            = kIOHIDMotionTypeNormal,
243    kIOHIDGyroTypeShake             = kIOHIDMotionTypeShake,
244};
245
246typedef IOHIDMotionType IOHIDAccelerometerType;
247typedef IOHIDMotionPath IOHIDAccelerometerSubType;
248
249enum {
250    kIOHIDEventFieldAccelerometerX = IOHIDEventFieldBase(kIOHIDEventTypeAccelerometer),
251    kIOHIDEventFieldAccelerometerY,
252    kIOHIDEventFieldAccelerometerZ,
253    kIOHIDEventFieldAccelerometerType,
254    kIOHIDEventFieldAccelerometerSubType,
255    kIOHIDEventFieldAccelerometerSequence,
256};
257
258typedef IOHIDMotionType IOHIDGyroType;
259typedef IOHIDMotionPath IOHIDGyroSubType;
260
261enum {
262    kIOHIDEventFieldGyroX = IOHIDEventFieldBase(kIOHIDEventTypeGyro),
263    kIOHIDEventFieldGyroY,
264    kIOHIDEventFieldGyroZ,
265    kIOHIDEventFieldGyroType,
266    kIOHIDEventFieldGyroSubType,
267    kIOHIDEventFieldGyroSequence
268};
269
270typedef IOHIDMotionType IOHIDCompassType;
271typedef IOHIDMotionPath IOHIDCompassSubType;
272
273enum {
274    kIOHIDEventFieldCompassX = IOHIDEventFieldBase(kIOHIDEventTypeCompass),
275    kIOHIDEventFieldCompassY,
276    kIOHIDEventFieldCompassZ,
277    kIOHIDEventFieldCompassType,
278    kIOHIDEventFieldCompassSubType,
279    kIOHIDEventFieldCompassSequence
280};
281
282enum {
283    kIOHIDEventFieldAmbientLightSensorLevel = IOHIDEventFieldBase(kIOHIDEventTypeAmbientLightSensor),
284    kIOHIDEventFieldAmbientLightSensorRawChannel0,
285    kIOHIDEventFieldAmbientLightSensorRawChannel1,
286    kIOHIDEventFieldAmbientLightSensorRawChannel2,
287    kIOHIDEventFieldAmbientLightSensorRawChannel3,
288    kIOHIDEventFieldAmbientLightDisplayBrightnessChanged
289};
290
291enum {
292    kIOHIDEventFieldTemperatureLevel = IOHIDEventFieldBase(kIOHIDEventTypeTemperature)
293};
294
295enum {
296    kIOHIDEventFieldProximityDetectionMask = IOHIDEventFieldBase(kIOHIDEventTypeProximity),
297    kIOHIDEventFieldProximityLevel
298};
299
300
301enum {
302    kIOHIDEventFieldOrientationRadius   = IOHIDEventFieldBase(kIOHIDEventTypeOrientation),
303    kIOHIDEventFieldOrientationAzimuth,
304    kIOHIDEventFieldOrientationAltitude
305};
306
307enum {
308    kIOHIDEventFieldKeyboardUsagePage = IOHIDEventFieldBase(kIOHIDEventTypeKeyboard),
309    kIOHIDEventFieldKeyboardUsage,
310    kIOHIDEventFieldKeyboardDown,
311    kIOHIDEventFieldKeyboardRepeat
312};
313
314enum {
315    kIOHIDEventFieldDigitizerX = IOHIDEventFieldBase(kIOHIDEventTypeDigitizer),
316    kIOHIDEventFieldDigitizerY,
317    kIOHIDEventFieldDigitizerZ,
318    kIOHIDEventFieldDigitizerButtonMask,
319    kIOHIDEventFieldDigitizerType,
320    kIOHIDEventFieldDigitizerIndex,
321    kIOHIDEventFieldDigitizerIdentity,
322    kIOHIDEventFieldDigitizerEventMask,
323    kIOHIDEventFieldDigitizerRange,
324    kIOHIDEventFieldDigitizerTouch,
325    kIOHIDEventFieldDigitizerPressure,
326    kIOHIDEventFieldDigitizerAuxiliaryPressure, //BarrelPressure
327    kIOHIDEventFieldDigitizerTwist,
328    kIOHIDEventFieldDigitizerTiltX,
329    kIOHIDEventFieldDigitizerTiltY,
330    kIOHIDEventFieldDigitizerAltitude,
331    kIOHIDEventFieldDigitizerAzimuth,
332    kIOHIDEventFieldDigitizerQuality,
333    kIOHIDEventFieldDigitizerDensity,
334    kIOHIDEventFieldDigitizerIrregularity,
335    kIOHIDEventFieldDigitizerMajorRadius,
336    kIOHIDEventFieldDigitizerMinorRadius,
337    kIOHIDEventFieldDigitizerCollection,
338    kIOHIDEventFieldDigitizerCollectionChord,
339    kIOHIDEventFieldDigitizerChildEventMask,
340    kIOHIDEventFieldDigitizerIsDisplayIntegrated,
341    kIOHIDEventFieldDigitizerQualityRadiiAccuracy,
342};
343
344enum {
345    kIOHIDEventFieldSwipeMask = IOHIDEventFieldBase(kIOHIDEventTypeSwipe),
346    kIOHIDEventFieldSwipeMotion,
347    kIOHIDEventFieldSwipeProgress,
348    kIOHIDEventFieldSwipePositionX,
349    kIOHIDEventFieldSwipePositionY,
350    kIOHIDEventFieldSwipeFlavor,
351};
352
353enum {
354    kIOHIDEventFieldNavigationSwipeMask = IOHIDEventFieldBase(kIOHIDEventTypeNavigationSwipe),
355    kIOHIDEventFieldNavigationSwipeMotion,
356    kIOHIDEventFieldNavigationSwipeProgress,
357    kIOHIDEventFieldNavigationSwipePositionX,
358    kIOHIDEventFieldNavigationSwipePositionY,
359    kIOHIDEventFieldNavagationSwipeFlavor,
360};
361
362enum {
363    kIOHIDEventFieldDockSwipeMask = IOHIDEventFieldBase(kIOHIDEventTypeDockSwipe),
364    kIOHIDEventFieldDockSwipeMotion,
365    kIOHIDEventFieldDockSwipeProgress,
366    kIOHIDEventFieldDockSwipePositionX,
367    kIOHIDEventFieldDockSwipePositionY,
368    kIOHIDEventFieldDockSwipeFlavor,
369};
370
371enum {
372    kIOHIDEventFieldFluidTouchGestureMask = IOHIDEventFieldBase(kIOHIDEventTypeFluidTouchGesture),
373    kIOHIDEventFieldFluidTouchGestureMotion,
374    kIOHIDEventFieldFluidTouchGestureProgress,
375    kIOHIDEventFieldFluidTouchGesturePositionX,
376    kIOHIDEventFieldFluidTouchGesturePositionY,
377    kIOHIDEventFieldFluidTouchGestureFlavor,
378};
379
380enum {
381    kIOHIDEventFieldBoundaryScrollMask = IOHIDEventFieldBase(kIOHIDEventTypeBoundaryScroll),
382    kIOHIDEventFieldBoundaryScrollMotion,
383    kIOHIDEventFieldBoundaryScrollProgress,
384    kIOHIDEventFieldBoundaryScrollPositionX,
385    kIOHIDEventFieldBoundaryScrollPositionY,
386    kIOHIDEventFieldBoundaryScrollFlavor,
387};
388
389enum {
390    kIOHIDEventFieldProgressEventType = IOHIDEventFieldBase(kIOHIDEventTypeProgress),
391    kIOHIDEventFieldProgressLevel,
392};
393
394enum {
395    kIOHIDEventFieldSymbolicHotKeyValue = IOHIDEventFieldBase(kIOHIDEventTypeSymbolicHotKey),
396    kIOHIDEventFieldSymbolicHotKeyIsCGSEvent,
397};
398
399/*!
400 @typedef IOHIDPowerType
401 @abstract Type of Power event triggered.
402 @discussion
403 @constant kIOHIDPowerTypePower
404 @constant kIOHIDPowerTypeCurrent
405 @constant kIOHIDPowerTypeVoltage
406 */
407enum {
408    kIOHIDPowerTypePower    = 0,
409    kIOHIDPowerTypeCurrent  = 1,
410    kIOHIDPowerTypeVoltage  = 2
411};
412typedef uint32_t IOHIDPowerType;
413
414/*!
415 @typedef IOHIDPowerSubType
416 @abstract Reserved
417 @discussion
418 @constant kIOHIDPowerSubTypeNormal
419 @constant kIOHIDPowerSubTypeCumulative
420 */
421enum {
422    kIOHIDPowerSubTypeNormal = 0,
423    kIOHIDPowerSubTypeCumulative
424};
425typedef uint32_t IOHIDPowerSubType;
426
427enum {
428    kIOHIDEventFieldPowerMeasurement = IOHIDEventFieldBase(kIOHIDEventTypePower),
429    kIOHIDEventFieldPowerType,
430    kIOHIDEventFieldPowerSubType,
431};
432
433/*!
434 @typedef IOHIDBiometricEventType
435 @abstract Type of biometric event triggered.
436 @discussion
437 @constant kIOHIDBiometricEventTypeHumanProximity
438 @constant kIOHIDBiometricEventTypeHumanTouch
439 @constant kIOHIDBiometricEventTypeHumanForce
440 */
441enum {
442    kIOHIDBiometricEventTypeHumanProximity = 0,
443    kIOHIDBiometricEventTypeHumanTouch,
444    kIOHIDBiometricEventTypeHumanForce
445};
446
447typedef uint32_t IOHIDBiometricEventType;
448
449enum {
450    kIOHIDEventFieldBiometricEventType = IOHIDEventFieldBase(kIOHIDEventTypeBiometric),
451    kIOHIDEventFieldBiometricLevel
452};
453
454enum {
455    kIOHIDEventFieldLEDMask = IOHIDEventFieldBase(kIOHIDEventTypeLED),
456    kIOHIDEventFieldLEDNumber,
457    kIOHIDEventFieldLEDState
458};
459
460
461enum {
462    kIOHIDUnicodeEncodingTypeUTF8,
463    kIOHIDUnicodeEncodingTypeUTF16LE,
464    kIOHIDUnicodeEncodingTypeUTF16BE,
465    kIOHIDUnicodeEncodingTypeUTF32LE,
466    kIOHIDUnicodeEncodingTypeUTF32BE,
467};
468typedef uint32_t IOHIDUnicodeEncodingType;
469
470/*!
471 @typedef IOHIDEventFieldUnicode
472 @abstract Event field corresponding the unicode events.
473 @discussion The HID Unicode Usage table states that currently only 2-octect are supported,
474             but considering that we can easily discern the size of the character field, it's
475             possible for us to convey variable length characters provided that the sizes
476             are byte aligned
477 @constant  kIOHIDEventFieldUnicodeEncoding event field selector representing the unicode encoding
478 @constant  kIOHIDEventFieldUnicodeQuality event field selector representing the quality of the character from 0.0 to 1.0
479@constant  kIOHIDEventFieldUnicodeLength event field selector representing the length/size
480            of the payload in bytes
481 @constant  kIOHIDEventFieldPayload event field selector representing the payload of size
482            references by kIOHIDEventFieldUnicodeLength
483 */
484
485enum {
486    kIOHIDEventFieldUnicodeEncoding     = IOHIDEventFieldBase(kIOHIDEventTypeUnicode),
487    kIOHIDEventFieldUnicodeQuality,
488    kIOHIDEventFieldUnicodeLength,
489    kIOHIDEventFieldUnicodePayload
490};
491
492enum {
493    kIOHIDEventFieldAtmosphericPressureLevel = IOHIDEventFieldBase(kIOHIDEventTypeAtmosphericPressure),
494    kIOHIDEventFieldAtmosphericSequence
495};
496
497typedef uint32_t IOHIDEventField;
498
499/*!
500    @typedef IOHIDSwipeMask
501    @abstract Mask detailing the type of swipe detected.
502    @discussion
503    @constant kIOHIDSwipeUp
504    @constant kIOHIDSwipeDown
505    @constant kIOHIDSwipeLeft
506    @constant kIOHIDSwipeRight
507*/
508enum {
509    kIOHIDSwipeNone             = 0,
510    kIOHIDSwipeUp               = 1<<0,
511    kIOHIDSwipeDown             = 1<<1,
512    kIOHIDSwipeLeft             = 1<<2,
513    kIOHIDSwipeRight            = 1<<3,
514    kIOHIDScaleExpand           = 1<<4,
515    kIOHIDScaleContract         = 1<<5,
516    kIOHIDRotateCW              = 1<<6,
517    kIOHIDRotateCCW             = 1<<7,
518};
519typedef uint32_t IOHIDSwipeMask;
520
521/*!
522    @typedef IOHIDGestureMotion
523    @abstract
524    @constant kIOHIDGestureMotionNone
525    @constant kIOHIDGestureMotionHorizontalX
526    @constant kIOHIDGestureMotionVerticalY
527    @constant kIOHIDGestureMotionScale
528    @constant kIOHIDGestureMotionRotate
529    @constant kIOHIDGestureMotionTap
530    @constant kIOHIDGestureMotionDoubleTap
531    @constant kIOHIDGestureMotionFromLeftEdge
532    @constant kIOHIDGestureMotionOffLeftEdge
533    @constant kIOHIDGestureMotionFromRightEdge
534    @constant kIOHIDGestureMotionOffRightEdge
535    @constant kIOHIDGestureMotionFromTopEdge
536    @constant kIOHIDGestureMotionOffTopEdge
537    @constant kIOHIDGestureMotionFromBottomEdge
538    @constant kIOHIDGestureMotionOffBottomEdge
539*/
540enum {
541    kIOHIDGestureMotionNone,
542    kIOHIDGestureMotionHorizontalX,
543    kIOHIDGestureMotionVerticalY,
544    kIOHIDGestureMotionScale,
545    kIOHIDGestureMotionRotate,
546    kIOHIDGestureMotionTap,
547    kIOHIDGestureMotionDoubleTap,
548    kIOHIDGestureMotionFromLeftEdge,
549    kIOHIDGestureMotionOffLeftEdge,
550    kIOHIDGestureMotionFromRightEdge,
551    kIOHIDGestureMotionOffRightEdge,
552    kIOHIDGestureMotionFromTopEdge,
553    kIOHIDGestureMotionOffTopEdge,
554    kIOHIDGestureMotionFromBottomEdge,
555    kIOHIDGestureMotionOffBottomEdge,
556};
557typedef uint16_t IOHIDGestureMotion;
558
559/*!
560    @typedef IOHIDGestureFlavor
561    @abstract
562    @constant kIOHIDGestureFlavorNone
563    @constant kIOHIDGestureFlavorNotificationCenterPrimary
564    @constant kIOHIDGestureFlavorNotificationCenterSecondary
565    @constant kIOHIDGestureFlavorDockPrimary
566    @constant kIOHIDGestureFlavorDockSecondary
567    @constant kIOHIDGestureFlavorNavagationPrimary
568    @constant kIOHIDGestureFlavorNavagationSecondary
569    @constant kIOHIDGestureFlavorControlCenterPrimary
570    @constant kIOHIDGestureFlavorControlCenterSecondary
571*/
572enum {
573    kIOHIDGestureFlavorNone,
574    kIOHIDGestureFlavorNotificationCenterPrimary,
575    kIOHIDGestureFlavorNotificationCenterSecondary,
576    kIOHIDGestureFlavorDockPrimary,
577    kIOHIDGestureFlavorDockSecondary,
578    kIOHIDGestureFlavorNavagationPrimary,
579    kIOHIDGestureFlavorNavagationSecondary,
580    kIOHIDGestureFlavorControlCenterPrimary,
581    kIOHIDGestureFlavorControlCenterSecondary,
582};
583typedef uint16_t IOHIDGestureFlavor;
584
585/*!
586    @typedef IOHIDProximityDetectionMask
587    @abstract Proximity mask detailing the inputs that were detected.
588    @discussion
589    @constant kIOHIDProximityDetectionLargeBodyContact
590    @constant kIOHIDProximityDetectionLargeBodyFarField
591    @constant kIOHIDProximityDetectionIrregularObjects
592    @constant kIOHIDProximityDetectionEdgeStraddling
593    @constant kIOHIDProximityDetectionFlatFingerClasp
594    @constant kIOHIDProximityDetectionFingerTouch
595    @constant kIOHIDProximityDetectionReceiver
596    @constant kIOHIDProximityDetectionSmallObjectsHovering
597    @constant kIOHIDProximityDetectionReceiverCrude
598    @constant kIOHIDProximityDetectionReceiverMonitoring
599*/
600enum {
601    kIOHIDProximityDetectionLargeBodyContact                = 1<<0,
602    kIOHIDProximityDetectionLargeBodyFarField               = 1<<1,
603    kIOHIDProximityDetectionIrregularObjects                = 1<<2,
604    kIOHIDProximityDetectionEdgeStraddling                  = 1<<3,
605    kIOHIDProximityDetectionFlatFingerClasp                 = 1<<4,
606    kIOHIDProximityDetectionFingerTouch                     = 1<<5,
607    kIOHIDProximityDetectionReceiver                        = 1<<6,
608    kIOHIDProximityDetectionSmallObjectsHovering            = 1<<7,
609    kIOHIDProximityDetectionReceiverCrude                   = 1<<8,
610    kIOHIDProximityDetectionReceiverMonitoring              = 1<<9
611};
612typedef uint32_t IOHIDProximityDetectionMask;
613
614/*!
615    @typedef IOHIDDigitizerType
616    @abstract The type of digitizer path initiating an event.
617    @constant kIOHIDDigitizerTransducerTypeStylus
618    @constant kIOHIDDigitizerTransducerTypePuck
619    @constant kIOHIDDigitizerTransducerTypeFinger
620    @constant kIOHIDDigitizerTransducerTypeHand
621*/
622enum {
623    kIOHIDDigitizerTransducerTypeStylus  = 0,
624    kIOHIDDigitizerTransducerTypePuck,
625    kIOHIDDigitizerTransducerTypeFinger,
626    kIOHIDDigitizerTransducerTypeHand
627};
628typedef uint32_t IOHIDDigitizerTransducerType;
629
630/*!
631    @typedef IOHIDDigitizerEventMask
632    @abstract Event mask detailing the events being dispatched by a digitizer.
633    @discussion It is possible for digitizer events to contain child digitizer events, effectively, behaving as collections.
634    In the collection case, the child event mask field referrence by kIOHIDEventFieldDigitizerChildEventMask will detail the
635    cumulative event state of the child digitizer events.
636    <br>
637    <b>Please Note:</b>
638    If you append a child digitizer event to a parent digitizer event, appropriate state will be transfered on to the parent.
639    @constant kIOHIDDigitizerEventRange Issued when the range state has changed.
640    @constant kIOHIDDigitizerEventTouch Issued when the touch state has changed.
641    @constant kIOHIDDigitizerEventPosition Issued when the position has changed.
642    @constant kIOHIDDigitizerEventStop Issued when motion has achieved a state of calculated non-movement.
643    @constant kIOHIDDigitizerEventPeak Issues when new maximum values have been detected.
644    @constant kIOHIDDigitizerEventIdentity Issued when the identity has changed.
645    @constant kIOHIDDigitizerEventAttribute Issued when an attribute has changed.
646    @constant kIOHIDDigitizerEventCancel
647    @constant kIOHIDDigitizerEventResting
648    @constant kIOHIDDigitizerEventFromEdgeFlat Issued when a digitizer approaches from the edge with flattened presentation
649    @constant kIOHIDDigitizerEventFromEdgeTip Issued when a digitizer approaches from the edge with standard (i.e. un-flattened) presentation.
650    @constant kIOHIDDigitizerEventFromCorner Issued when a digitizer approaches from a corner
651    @constant kIOHIDDigitizerEventSwipePending Issued to indicate that an edge swipe is pending
652    @constant kIOHIDDigitizerEventUpSwipe Issued when an up swipe has been detected.
653    @constant kIOHIDDigitizerEventDownSwipe Issued when an down swipe has been detected.
654    @constant kIOHIDDigitizerEventLeftSwipe Issued when an left swipe has been detected.
655    @constant kIOHIDDigitizerEventRightSwipe Issued when an right swipe has been detected.
656    @constant kIOHIDDigitizerEventSwipeMask Mask used to gather swipe events.
657*/
658enum {
659    kIOHIDDigitizerEventRange                               = 1<<0,
660    kIOHIDDigitizerEventTouch                               = 1<<1,
661    kIOHIDDigitizerEventPosition                            = 1<<2,
662    kIOHIDDigitizerEventStop                                = 1<<3,
663    kIOHIDDigitizerEventPeak                                = 1<<4,
664    kIOHIDDigitizerEventIdentity                            = 1<<5,
665    kIOHIDDigitizerEventAttribute                           = 1<<6,
666    kIOHIDDigitizerEventCancel                              = 1<<7,
667    kIOHIDDigitizerEventStart                               = 1<<8,
668    kIOHIDDigitizerEventResting                             = 1<<9,
669    kIOHIDDigitizerEventFromEdgeFlat                        = 1<<10,
670    kIOHIDDigitizerEventFromEdgeTip                         = 1<<11,
671    kIOHIDDigitizerEventFromCorner                          = 1<<12,
672    kIOHIDDigitizerEventSwipePending                        = 1<<13,
673    kIOHIDDigitizerEventSwipeUp                             = 1<<24,
674    kIOHIDDigitizerEventSwipeDown                           = 1<<25,
675    kIOHIDDigitizerEventSwipeLeft                           = 1<<26,
676    kIOHIDDigitizerEventSwipeRight                          = 1<<27,
677    kIOHIDDigitizerEventSwipeMask                           = 0xFF<<24,
678};
679typedef uint32_t IOHIDDigitizerEventMask;
680
681enum {
682    kIOHIDEventOptionNone                                   = 0,
683    kIOHIDEventOptionIsAbsolute                             = 1<<0,
684    kIOHIDEventOptionIsCollection                           = 1<<1,
685    kIOHIDEventOptionIsPixelUnits                           = 1<<2,
686    kIOHIDEventOptionIsCenterOrigin                         = 1<<3,
687    kIOHIDEventOptionIsBuiltIn                              = 1<<4,
688
689    // misspellings
690    kIOHIDEventOptionPixelUnits                             = kIOHIDEventOptionIsPixelUnits,
691};
692typedef uint32_t IOHIDEventOptionBits;
693
694enum {
695    kIOHIDEventPhaseUndefined                               = 0,
696    kIOHIDEventPhaseBegan                                   = 1<<0,
697    kIOHIDEventPhaseChanged                                 = 1<<1,
698    kIOHIDEventPhaseEnded                                   = 1<<2,
699    kIOHIDEventPhaseCancelled                               = 1<<3,
700    kIOHIDEventPhaseMayBegin                                = 1<<7,
701    kIOHIDEventEventPhaseMask                               = 0xFF,
702    kIOHIDEventEventOptionPhaseShift                        = 24,
703};
704typedef uint16_t IOHIDEventPhaseBits;
705
706/*!
707 @typedef IOHIDSymbolicHotKey
708 @abstract Enumerted values for sending symbolic hot key events.
709 @constant kIOHIDSymbolicHotKeyDictionaryApp    This will get translated into a kCGSDictionaryAppHotKey by CG.
710 @constant kIOHIDSymbolicHotKeyIronwoodApp      This will get translated into a kCGSIronwoodHotKey by CG.
711 @constant kIOHIDSymbolicHotKeyDictationApp     This will get translated into a kCGSDictationHotKey by CG.
712 @constant kIOHIDSymbolicHotKeyOptionIsCGSHotKey
713                                                This is an option flag to denote that the SymbolicHotKey value is
714                                                actually from the enumeration in CGSHotKeys.h.
715 */
716enum {
717    kIOHIDSymbolicHotKeyUndefined,
718    kIOHIDSymbolicHotKeyDictionaryApp,
719    kIOHIDSymbolicHotKeyIronwoodApp,
720    kIOHIDSymbolicHotKeyDictationApp,
721
722    // for kIOHIDSymbolicHotKeyOptionIsCGSHotKey, see IOHIDFamily/IOHIDEventData.h
723};
724typedef uint32_t IOHIDSymbolicHotKeyValue;
725
726
727enum {
728    kIOHIDEventSenderIDUndefined                            = 0x0000000000000000LL,
729};
730typedef uint64_t IOHIDEventSenderID; // must be the same size as that returned from IORegistryEntry::getRegistryEntryID
731
732#ifndef KERNEL
733/*!
734    @typedef IOHIDFloat
735*/
736#ifdef __LP64__
737typedef double IOHIDFloat;
738#else
739typedef float IOHIDFloat;
740#endif
741/*!
742    @typedef IOHID3DPoint
743*/
744typedef struct _IOHID3DPoint {
745    IOHIDFloat  x;
746    IOHIDFloat  y;
747    IOHIDFloat  z;
748} IOHID3DPoint;
749#endif
750
751#endif /* _IOKIT_HID_IOHIDEVENTTYPES_H } */
752