Add keyboard handling

This commit is contained in:
Sharat M R 2019-04-26 21:41:45 +05:30
parent 15ba6869e2
commit dea9bd191d
No known key found for this signature in database
GPG Key ID: E450A6E45DAE1B94
7 changed files with 2799 additions and 2 deletions

126
KeyboardHandle.xm Normal file
View File

@ -0,0 +1,126 @@
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <rfb/keysym.h>
#include <IOKit/hidsystem/IOHIDUsageTables.h>
extern "C" {
typedef uint32_t IOHIDEventOptionBits;
typedef struct __IOHIDEvent *IOHIDEventRef;
typedef struct CF_BRIDGED_TYPE(id) __IOHIDEventSystemClient * IOHIDEventSystemClientRef;
IOHIDEventRef IOHIDEventCreateKeyboardEvent(
CFAllocatorRef allocator,
uint64_t time, uint16_t page, uint16_t usage,
Boolean down, IOHIDEventOptionBits flags
);
// IOHIDEventRef IOHIDEventCreateDigitizerEvent(CFAllocatorRef allocator, uint64_t timeStamp, IOHIDDigitizerTransducerType type, uint32_t index, uint32_t identity, uint32_t eventMask, uint32_t buttonMask, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat barrelPressure, Boolean range, Boolean touch, IOOptionBits options);
// IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef allocator, uint64_t timeStamp, uint32_t index, uint32_t identity, uint32_t eventMask, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat twist, Boolean range, Boolean touch, IOOptionBits options);
IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef allocator);
// void IOHIDEventAppendEvent(IOHIDEventRef parent, IOHIDEventRef child);
// void IOHIDEventSetIntegerValue(IOHIDEventRef event, IOHIDEventField field, int value);
void IOHIDEventSetSenderID(IOHIDEventRef event, uint64_t sender);
void IOHIDEventSystemClientDispatchEvent(IOHIDEventSystemClientRef client, IOHIDEventRef event);
// void IOHIDEventSystemConnectionDispatchEvent(IOHIDEventSystemConnectionRef connection, IOHIDEventRef event);
}
static void VNCSendHIDEvent(IOHIDEventRef event) {
static IOHIDEventSystemClientRef client_(NULL);
if (client_ == NULL)
client_ = IOHIDEventSystemClientCreate(kCFAllocatorDefault);
IOHIDEventSetSenderID(event, 0xDEFACEDBEEFFECE5);
IOHIDEventSystemClientDispatchEvent(client_, event);
CFRelease(event);
}
static void VNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client) {
uint16_t usage;
switch (key) {
case XK_exclam: case XK_1: usage = kHIDUsage_Keyboard1; break;
case XK_at: case XK_2: usage = kHIDUsage_Keyboard2; break;
case XK_numbersign: case XK_3: usage = kHIDUsage_Keyboard3; break;
case XK_dollar: case XK_4: usage = kHIDUsage_Keyboard4; break;
case XK_percent: case XK_5: usage = kHIDUsage_Keyboard5; break;
case XK_asciicircum: case XK_6: usage = kHIDUsage_Keyboard6; break;
case XK_ampersand: case XK_7: usage = kHIDUsage_Keyboard7; break;
case XK_asterisk: case XK_8: usage = kHIDUsage_Keyboard8; break;
case XK_parenleft: case XK_9: usage = kHIDUsage_Keyboard9; break;
case XK_parenright: case XK_0: usage = kHIDUsage_Keyboard0; break;
case XK_A: case XK_a: usage = kHIDUsage_KeyboardA; break;
case XK_B: case XK_b: usage = kHIDUsage_KeyboardB; break;
case XK_C: case XK_c: usage = kHIDUsage_KeyboardC; break;
case XK_D: case XK_d: usage = kHIDUsage_KeyboardD; break;
case XK_E: case XK_e: usage = kHIDUsage_KeyboardE; break;
case XK_F: case XK_f: usage = kHIDUsage_KeyboardF; break;
case XK_G: case XK_g: usage = kHIDUsage_KeyboardG; break;
case XK_H: case XK_h: usage = kHIDUsage_KeyboardH; break;
case XK_I: case XK_i: usage = kHIDUsage_KeyboardI; break;
case XK_J: case XK_j: usage = kHIDUsage_KeyboardJ; break;
case XK_K: case XK_k: usage = kHIDUsage_KeyboardK; break;
case XK_L: case XK_l: usage = kHIDUsage_KeyboardL; break;
case XK_M: case XK_m: usage = kHIDUsage_KeyboardM; break;
case XK_N: case XK_n: usage = kHIDUsage_KeyboardN; break;
case XK_O: case XK_o: usage = kHIDUsage_KeyboardO; break;
case XK_P: case XK_p: usage = kHIDUsage_KeyboardP; break;
case XK_Q: case XK_q: usage = kHIDUsage_KeyboardQ; break;
case XK_R: case XK_r: usage = kHIDUsage_KeyboardR; break;
case XK_S: case XK_s: usage = kHIDUsage_KeyboardS; break;
case XK_T: case XK_t: usage = kHIDUsage_KeyboardT; break;
case XK_U: case XK_u: usage = kHIDUsage_KeyboardU; break;
case XK_V: case XK_v: usage = kHIDUsage_KeyboardV; break;
case XK_W: case XK_w: usage = kHIDUsage_KeyboardW; break;
case XK_X: case XK_x: usage = kHIDUsage_KeyboardX; break;
case XK_Y: case XK_y: usage = kHIDUsage_KeyboardY; break;
case XK_Z: case XK_z: usage = kHIDUsage_KeyboardZ; break;
case XK_underscore: case XK_minus: usage = kHIDUsage_KeyboardHyphen; break;
case XK_plus: case XK_equal: usage = kHIDUsage_KeyboardEqualSign; break;
case XK_braceleft: case XK_bracketleft: usage = kHIDUsage_KeyboardOpenBracket; break;
case XK_braceright: case XK_bracketright: usage = kHIDUsage_KeyboardCloseBracket; break;
case XK_bar: case XK_backslash: usage = kHIDUsage_KeyboardBackslash; break;
case XK_colon: case XK_semicolon: usage = kHIDUsage_KeyboardSemicolon; break;
case XK_quotedbl: case XK_apostrophe: usage = kHIDUsage_KeyboardQuote; break;
case XK_asciitilde: case XK_grave: usage = kHIDUsage_KeyboardGraveAccentAndTilde; break;
case XK_less: case XK_comma: usage = kHIDUsage_KeyboardComma; break;
case XK_greater: case XK_period: usage = kHIDUsage_KeyboardPeriod; break;
case XK_question: case XK_slash: usage = kHIDUsage_KeyboardSlash; break;
case XK_Return: usage = kHIDUsage_KeyboardReturnOrEnter; break;
case XK_BackSpace: usage = kHIDUsage_KeyboardDeleteOrBackspace; break;
case XK_Tab: usage = kHIDUsage_KeyboardTab; break;
case XK_space: usage = kHIDUsage_KeyboardSpacebar; break;
case XK_Shift_L: usage = kHIDUsage_KeyboardLeftShift; break;
case XK_Shift_R: usage = kHIDUsage_KeyboardRightShift; break;
case XK_Control_L: usage = kHIDUsage_KeyboardLeftControl; break;
case XK_Control_R: usage = kHIDUsage_KeyboardRightControl; break;
case XK_Meta_L: usage = kHIDUsage_KeyboardLeftAlt; break;
case XK_Meta_R: usage = kHIDUsage_KeyboardRightAlt; break;
case XK_Alt_L: usage = kHIDUsage_KeyboardLeftGUI; break;
case XK_Alt_R: usage = kHIDUsage_KeyboardRightGUI; break;
case XK_Up: usage = kHIDUsage_KeyboardUpArrow; break;
case XK_Down: usage = kHIDUsage_KeyboardDownArrow; break;
case XK_Left: usage = kHIDUsage_KeyboardLeftArrow; break;
case XK_Right: usage = kHIDUsage_KeyboardRightArrow; break;
case XK_Home: case XK_Begin: usage = kHIDUsage_KeyboardHome; break;
case XK_End: usage = kHIDUsage_KeyboardEnd; break;
case XK_Page_Up: usage = kHIDUsage_KeyboardPageUp; break;
case XK_Page_Down: usage = kHIDUsage_KeyboardPageDown; break;
default: return;
}
VNCSendHIDEvent(IOHIDEventCreateKeyboardEvent(kCFAllocatorDefault, mach_absolute_time(), kHIDPage_KeyboardOrKeypad, usage, down, 0));
}
static void handleVNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client) {
NSLog(@"sharat d:%u k:%04x", down, key);
VNCKeyboard(down, key, client);
}

View File

@ -5,10 +5,10 @@ include $(THEOS)/makefiles/common.mk
TWEAK_NAME = screendump TWEAK_NAME = screendump
screendump_FILES = Tweak.xm screendump_FILES = Tweak.xm
screendump_FRAMEWORKS := IOSurface screendump_FRAMEWORKS := IOSurface IOKit
screendump_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface screendump_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface
ADDITIONAL_OBJCFLAGS += -Ivncbuild/include ADDITIONAL_OBJCFLAGS += -Ivncbuild/include -Iinclude
ADDITIONAL_LDFLAGS += -Lvncbuild/lib -lvncserver -lpng -llzo2 -ljpeg -lssl -lcrypto -lz ADDITIONAL_LDFLAGS += -Lvncbuild/lib -lvncserver -lpng -llzo2 -ljpeg -lssl -lcrypto -lz
ADDITIONAL_CFLAGS = -w ADDITIONAL_CFLAGS = -w

View File

@ -2,6 +2,8 @@
#include <substrate.h> #include <substrate.h>
#include <rfb/rfb.h> #include <rfb/rfb.h>
#include "KeyboardHandle.xm"
static bool CCSisEnabled = true; static bool CCSisEnabled = true;
static rfbScreenInfoPtr screen; static rfbScreenInfoPtr screen;
static bool isVNCRunning; static bool isVNCRunning;
@ -52,6 +54,7 @@ static void VNCSetup() {
screen->serverFormat.redShift = bits_per_sample * 2; screen->serverFormat.redShift = bits_per_sample * 2;
screen->serverFormat.greenShift = bits_per_sample * 1; screen->serverFormat.greenShift = bits_per_sample * 1;
screen->serverFormat.blueShift = bits_per_sample * 0; screen->serverFormat.blueShift = bits_per_sample * 0;
screen->kbdAddEvent = &handleVNCKeyboard;
free(arg0); free(arg0);
} }

137
include/IOKit/IOReturn.h Normal file
View File

@ -0,0 +1,137 @@
/*
* Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* HISTORY
*/
/*
* Core IOReturn values. Others may be family defined.
*/
#ifndef __IOKIT_IORETURN_H
#define __IOKIT_IORETURN_H
#ifdef __cplusplus
extern "C" {
#endif
#include <mach/error.h>
typedef kern_return_t IOReturn;
#ifndef sys_iokit
#define sys_iokit err_system(0x38)
#endif /* sys_iokit */
#define sub_iokit_common err_sub(0)
#define sub_iokit_usb err_sub(1)
#define sub_iokit_firewire err_sub(2)
#define sub_iokit_block_storage err_sub(4)
#define sub_iokit_graphics err_sub(5)
#define sub_iokit_networking err_sub(6)
#define sub_iokit_bluetooth err_sub(8)
#define sub_iokit_pmu err_sub(9)
#define sub_iokit_acpi err_sub(10)
#define sub_iokit_smbus err_sub(11)
#define sub_iokit_ahci err_sub(12)
#define sub_iokit_powermanagement err_sub(13)
//#define sub_iokit_hidsystem err_sub(14)
#define sub_iokit_scsi err_sub(16)
//#define sub_iokit_pccard err_sub(21)
#define sub_iokit_vendor_specific err_sub(-2)
#define sub_iokit_reserved err_sub(-1)
#define iokit_common_err(return) (sys_iokit|sub_iokit_common|return)
#define iokit_family_err(sub,return) (sys_iokit|sub|return)
#define iokit_vendor_specific_err(return) (sys_iokit|sub_iokit_vendor_specific|return)
#define kIOReturnSuccess KERN_SUCCESS // OK
#define kIOReturnError iokit_common_err(0x2bc) // general error
#define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory
#define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage
#define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC
#define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device
#define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation
#define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument
#define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked
#define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked
#define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and
// device already open
#define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages
// had different msg_id
#define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function
#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure
#define kIOReturnInternalError iokit_common_err(0x2c9) // internal error
#define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error
//#define kIOReturn???Error iokit_common_err(0x2cb) // ???
#define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock
#define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open
#define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported
#define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported
#define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error
#define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error
#define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open
#define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure
#define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure
#define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy
#define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout
#define kIOReturnOffline iokit_common_err(0x2d7) // device offline
#define kIOReturnNotReady iokit_common_err(0x2d8) // not ready
#define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached
#define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left
#define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data
//#define kIOReturn???Error iokit_common_err(0x2dc) // ???
#define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists
#define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down
// physical memory
#define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached
#define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued
#define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received
// on interrupt port
#define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted
#define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device
#define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present
#define kIOReturnUnformattedMedia iokit_common_err(0x2e5)// media not formatted
#define kIOReturnUnsupportedMode iokit_common_err(0x2e6) // no such mode
#define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun
#define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun
#define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly!
#define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required
#define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted
#define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded
#define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding
#define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past!
#define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future
#define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found
#define kIOReturnInvalid iokit_common_err(0x1) // should never be seen
#ifdef __cplusplus
}
#endif
#endif /* ! __IOKIT_IORETURN_H */

250
include/IOKit/IOTypes.h Normal file
View File

@ -0,0 +1,250 @@
/*
* Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef __IOKIT_IOTYPES_H
#define __IOKIT_IOTYPES_H
#ifndef IOKIT
#define IOKIT 1
#endif /* !IOKIT */
#if KERNEL
#include <IOKit/system.h>
#else
#include <mach/message.h>
#include <mach/vm_types.h>
#endif
#include <IOKit/IOReturn.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NULL
#if defined (__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
/*
* Simple data types.
*/
#ifndef __MACTYPES__ /* CF MacTypes.h */
#ifndef __TYPES__ /* guess... Mac Types.h */
#include <stdbool.h>
#include <libkern/OSTypes.h>
#endif /* __TYPES__ */
#endif /* __MACTYPES__ */
#if KERNEL
#include <libkern/OSBase.h>
#endif
typedef UInt32 IOOptionBits;
typedef SInt32 IOFixed;
typedef UInt32 IOVersion;
typedef UInt32 IOItemCount;
typedef UInt32 IOCacheMode;
typedef UInt32 IOByteCount32;
typedef UInt64 IOByteCount64;
typedef UInt32 IOPhysicalAddress32;
typedef UInt64 IOPhysicalAddress64;
typedef UInt32 IOPhysicalLength32;
typedef UInt64 IOPhysicalLength64;
#ifdef __LP64__
typedef mach_vm_address_t IOVirtualAddress;
#else
typedef vm_address_t IOVirtualAddress;
#endif
#if defined(__LP64__) && defined(KERNEL)
typedef IOByteCount64 IOByteCount;
#else
typedef IOByteCount32 IOByteCount;
#endif
typedef IOVirtualAddress IOLogicalAddress;
#if defined(__LP64__) && defined(KERNEL)
typedef IOPhysicalAddress64 IOPhysicalAddress;
typedef IOPhysicalLength64 IOPhysicalLength;
#define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
#define IOPhysSize 64
#else
typedef IOPhysicalAddress32 IOPhysicalAddress;
typedef IOPhysicalLength32 IOPhysicalLength;
#define IOPhysical32( hi, lo ) (lo)
#define IOPhysSize 32
#endif
typedef struct
{
IOPhysicalAddress address;
IOByteCount length;
} IOPhysicalRange;
typedef struct
{
IOVirtualAddress address;
IOByteCount length;
} IOVirtualRange;
#ifdef __LP64__
typedef IOVirtualRange IOAddressRange;
#else /* !__LP64__ */
typedef struct
{
mach_vm_address_t address;
mach_vm_size_t length;
} IOAddressRange;
#endif /* !__LP64__ */
/*
* Map between #defined or enum'd constants and text description.
*/
typedef struct {
int value;
const char *name;
} IONamedValue;
/*
* Memory alignment -- specified as a power of two.
*/
typedef unsigned int IOAlignment;
#define IO_NULL_VM_TASK ((vm_task_t)0)
/*
* Pull in machine specific stuff.
*/
//#include <IOKit/machine/IOTypes.h>
#ifndef MACH_KERNEL
#ifndef __IOKIT_PORTS_DEFINED__
#define __IOKIT_PORTS_DEFINED__
#ifdef KERNEL
typedef struct OSObject * io_object_t;
#else /* KERNEL */
typedef mach_port_t io_object_t;
#endif /* KERNEL */
#endif /* __IOKIT_PORTS_DEFINED__ */
#include <device/device_types.h>
typedef io_object_t io_connect_t;
typedef io_object_t io_enumerator_t;
typedef io_object_t io_iterator_t;
typedef io_object_t io_registry_entry_t;
typedef io_object_t io_service_t;
#define IO_OBJECT_NULL ((io_object_t) 0)
#endif /* MACH_KERNEL */
// IOConnectMapMemory memoryTypes
enum {
kIODefaultMemoryType = 0
};
enum {
kIODefaultCache = 0,
kIOInhibitCache = 1,
kIOWriteThruCache = 2,
kIOCopybackCache = 3,
kIOWriteCombineCache = 4
};
// IOMemory mapping options
enum {
kIOMapAnywhere = 0x00000001,
kIOMapCacheMask = 0x00000700,
kIOMapCacheShift = 8,
kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift,
kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift,
kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift,
kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift,
kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift,
kIOMapUserOptionsMask = 0x00000fff,
kIOMapReadOnly = 0x00001000,
kIOMapStatic = 0x01000000,
kIOMapReference = 0x02000000,
kIOMapUnique = 0x04000000
#ifdef XNU_KERNEL_PRIVATE
, kIOMap64Bit = 0x08000000
#endif
};
/*! @enum Scale Factors
@discussion Used when a scale_factor parameter is required to define a unit of time.
@constant kNanosecondScale Scale factor for nanosecond based times.
@constant kMicrosecondScale Scale factor for microsecond based times.
@constant kMillisecondScale Scale factor for millisecond based times.
@constant kTickScale Scale factor for the standard (100Hz) tick.
@constant kSecondScale Scale factor for second based times. */
enum {
kNanosecondScale = 1,
kMicrosecondScale = 1000,
kMillisecondScale = 1000 * 1000,
kSecondScale = 1000 * 1000 * 1000,
kTickScale = (kSecondScale / 100)
};
/* compatibility types */
#ifndef KERNEL
typedef unsigned int IODeviceNumber;
#endif
#ifdef __cplusplus
}
#endif
#endif /* ! __IOKIT_IOTYPES_H */

View File

@ -0,0 +1,616 @@
/*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_HID_IOHIDEVENTTYPES_H
#define _IOKIT_HID_IOHIDEVENTTYPES_H /* { */
#include <IOKit/IOTypes.h>
#define IOHIDEventTypeMask(type) (1<<type)
#define IOHIDEventFieldBase(type) (type << 16)
/*!
@typedef IOHIDEventType
@abstract The type of event represented by an IOHIDEventRef.
@discussion It is possible that a single IOHIDEventRef can conform to
multiple event types through the use of sub events. For futher information
as to how to determinte the type of event please reference IOHIDEventGetType
and IOHIDEventConformsTo.
@constant kIOHIDEventTypeNULL
@constant kIOHIDEventTypeVendorDefined
@constant kIOHIDEventTypeButton
@constant kIOHIDEventTypeTranslation
@constant kIOHIDEventTypeRotation
@constant kIOHIDEventTypeScroll
@constant kIOHIDEventTypeScale
@constant kIOHIDEventTypeVelocity
@constant kIOHIDEventTypeOrientation
@constant kIOHIDEventTypeKeyboard
@constant kIOHIDEventTypeDigitizer
@constant kIOHIDEventTypeAmbientLightSensor
@constant kIOHIDEventTypeAccelerometer
@constant kIOHIDEventTypeProximity
@constant kIOHIDEventTypeTemperature
@constant kIOHIDEventTypeMouse
@constant kIOHIDEventTypeProgress
@constant kIOHIDEventTypeNavigationSwipe
@constant kIOHIDEventTypeGyro
@constant kIOHIDEventTypeCompass
@constant kIOHIDEventTypeZoomToggle
@constant kIOHIDEventTypeDockSwipe
@constant kIOHIDEventTypePower
@constant kIOHIDEventTypeBrightness
@constant kIOHIDEventTypeFluidTouchGesture
@constant kIOHIDEventTypeBoundaryScroll
@constant kIOHIDEventTypeReset
*/
enum {
kIOHIDEventTypeNULL, // 0
kIOHIDEventTypeVendorDefined,
kIOHIDEventTypeButton,
kIOHIDEventTypeKeyboard,
kIOHIDEventTypeTranslation,
kIOHIDEventTypeRotation, // 5
kIOHIDEventTypeScroll,
kIOHIDEventTypeScale,
kIOHIDEventTypeZoom,
kIOHIDEventTypeVelocity,
kIOHIDEventTypeOrientation, // 10
kIOHIDEventTypeDigitizer,
kIOHIDEventTypeAmbientLightSensor,
kIOHIDEventTypeAccelerometer,
kIOHIDEventTypeProximity,
kIOHIDEventTypeTemperature, // 15
kIOHIDEventTypeNavigationSwipe,
kIOHIDEventTypeSwipe = kIOHIDEventTypeNavigationSwipe,
kIOHIDEventTypeMouse,
kIOHIDEventTypeProgress,
kIOHIDEventTypeCount,
kIOHIDEventTypeGyro, // 20
kIOHIDEventTypeCompass,
kIOHIDEventTypeZoomToggle,
kIOHIDEventTypeDockSwipe, // just like kIOHIDEventTypeNavigationSwipe, but intended for consumption by Dock
kIOHIDEventTypeSymbolicHotKey,
kIOHIDEventTypePower, // 25
kIOHIDEventTypeBrightness,
kIOHIDEventTypeFluidTouchGesture, // This will eventually superseed Navagation and Dock swipes
kIOHIDEventTypeBoundaryScroll,
kIOHIDEventTypeReset,
};
typedef uint32_t IOHIDEventType;
/*
@typedef IOHIDEventField
@abstract Keys used to set and get individual event fields.
*/
enum {
kIOHIDEventFieldIsRelative = IOHIDEventFieldBase(kIOHIDEventTypeNULL),
kIOHIDEventFieldIsCollection
};
enum {
kIOHIDEventFieldVendorDefinedUsagePage = IOHIDEventFieldBase(kIOHIDEventTypeVendorDefined),
kIOHIDEventFieldVendorDefinedUsage,
kIOHIDEventFieldVendorDefinedVersion,
kIOHIDEventFieldVendorDefinedDataLength,
kIOHIDEventFieldVendorDefinedData
};
enum {
kIOHIDEventFieldButtonMask = IOHIDEventFieldBase(kIOHIDEventTypeButton),
kIOHIDEventFieldButtonNumber,
kIOHIDEventFieldButtonClickCount,
kIOHIDEventFieldButtonPressure
};
enum {
kIOHIDEventFieldTranslationX = IOHIDEventFieldBase(kIOHIDEventTypeTranslation),
kIOHIDEventFieldTranslationY,
kIOHIDEventFieldTranslationZ
};
enum {
kIOHIDEventFieldRotationX = IOHIDEventFieldBase(kIOHIDEventTypeRotation),
kIOHIDEventFieldRotationY,
kIOHIDEventFieldRotationZ
};
enum {
kIOHIDEventFieldScrollX = IOHIDEventFieldBase(kIOHIDEventTypeScroll),
kIOHIDEventFieldScrollY,
kIOHIDEventFieldScrollZ,
kIOHIDEventFieldScrollIsPixels
};
enum {
kIOHIDEventFieldScaleX = IOHIDEventFieldBase(kIOHIDEventTypeScale),
kIOHIDEventFieldScaleY,
kIOHIDEventFieldScaleZ
};
enum {
kIOHIDEventFieldVelocityX = IOHIDEventFieldBase(kIOHIDEventTypeVelocity),
kIOHIDEventFieldVelocityY,
kIOHIDEventFieldVelocityZ
};
/*!
@typedef IOHIDMotionType
@abstract Type of Motion event triggered.
@discussion
@constant kIOHIDMotionStart
@constant kIOHIDMotionEnd
*/
enum {
kIOHIDMotionStart = 0,
kIOHIDMotionEnd = 1,
};
typedef uint32_t IOHIDMotionType;
/*!
@typedef IOHIDAccelerometerType
@abstract Type of accelerometer event triggered.
@discussion
@constant kIOHIDAccelerometerTypeNormal
@constant kIOHIDAccelerometerTypeShake
*/
enum {
kIOHIDAccelerometerTypeNormal = 0,
kIOHIDAccelerometerTypeShake = 1
};
typedef uint32_t IOHIDAccelerometerType;
typedef IOHIDMotionType IOHIDAccelerometerSubType;
enum {
kIOHIDEventFieldAccelerometerX = IOHIDEventFieldBase(kIOHIDEventTypeAccelerometer),
kIOHIDEventFieldAccelerometerY,
kIOHIDEventFieldAccelerometerZ,
kIOHIDEventFieldAccelerometerType,
kIOHIDEventFieldAccelerometerSubType
};
enum {
kIOHIDEventFieldMouseX = IOHIDEventFieldBase(kIOHIDEventTypeMouse),
kIOHIDEventFieldMouseY,
kIOHIDEventFieldMouseZ,
kIOHIDEventFieldMouseButtonMask,
kIOHIDEventFieldMouseNumber,
kIOHIDEventFieldMouseClickCount,
kIOHIDEventFieldMousePressure
};
/*!
@typedef IOHIDGyroType
@abstract Type of Gyro event triggered.
@discussion
@constant kIOHIDGyroTypeNormal
@constant kIOHIDGyroTypeShake
*/
enum {
kIOHIDGyroTypeNormal = 0,
kIOHIDGyroTypeShake = 1,
kIOHIDGyroTypeMotion = 2
};
typedef uint32_t IOHIDGyroType;
typedef IOHIDMotionType IOHIDGyroSubType ;
enum {
kIOHIDEventFieldGyroX = IOHIDEventFieldBase(kIOHIDEventTypeGyro),
kIOHIDEventFieldGyroY,
kIOHIDEventFieldGyroZ,
kIOHIDEventFieldGyroType,
kIOHIDEventFieldGyroSubType,
};
typedef IOHIDMotionType IOHIDCompassType ;
enum {
kIOHIDEventFieldCompassX = IOHIDEventFieldBase(kIOHIDEventTypeCompass),
kIOHIDEventFieldCompassY,
kIOHIDEventFieldCompassZ,
kIOHIDEventFieldCompassType
};
enum {
kIOHIDEventFieldAmbientLightSensorLevel = IOHIDEventFieldBase(kIOHIDEventTypeAmbientLightSensor),
kIOHIDEventFieldAmbientLightSensorRawChannel0,
kIOHIDEventFieldAmbientLightSensorRawChannel1,
kIOHIDEventFieldAmbientLightSensorRawChannel2,
kIOHIDEventFieldAmbientLightSensorRawChannel3,
kIOHIDEventFieldAmbientLightDisplayBrightnessChanged
};
enum {
kIOHIDEventFieldTemperatureLevel = IOHIDEventFieldBase(kIOHIDEventTypeTemperature)
};
enum {
kIOHIDEventFieldProximityDetectionMask = IOHIDEventFieldBase(kIOHIDEventTypeProximity),
kIOHIDEventFieldProximityLevel
};
enum {
kIOHIDEventFieldOrientationRadius = IOHIDEventFieldBase(kIOHIDEventTypeOrientation),
kIOHIDEventFieldOrientationAzimuth,
kIOHIDEventFieldOrientationAltitude
};
enum {
kIOHIDEventFieldKeyboardUsagePage = IOHIDEventFieldBase(kIOHIDEventTypeKeyboard),
kIOHIDEventFieldKeyboardUsage,
kIOHIDEventFieldKeyboardDown,
kIOHIDEventFieldKeyboardRepeat
};
enum {
kIOHIDEventFieldDigitizerX = IOHIDEventFieldBase(kIOHIDEventTypeDigitizer),
kIOHIDEventFieldDigitizerY,
kIOHIDEventFieldDigitizerZ,
kIOHIDEventFieldDigitizerButtonMask,
kIOHIDEventFieldDigitizerType,
kIOHIDEventFieldDigitizerIndex,
kIOHIDEventFieldDigitizerIdentity,
kIOHIDEventFieldDigitizerEventMask,
kIOHIDEventFieldDigitizerRange,
kIOHIDEventFieldDigitizerTouch,
kIOHIDEventFieldDigitizerPressure,
kIOHIDEventFieldDigitizerBarrelPressure,
kIOHIDEventFieldDigitizerTwist,
kIOHIDEventFieldDigitizerTiltX,
kIOHIDEventFieldDigitizerTiltY,
kIOHIDEventFieldDigitizerAltitude,
kIOHIDEventFieldDigitizerAzimuth,
kIOHIDEventFieldDigitizerQuality,
kIOHIDEventFieldDigitizerDensity,
kIOHIDEventFieldDigitizerIrregularity,
kIOHIDEventFieldDigitizerMajorRadius,
kIOHIDEventFieldDigitizerMinorRadius,
kIOHIDEventFieldDigitizerCollection,
kIOHIDEventFieldDigitizerCollectionChord,
kIOHIDEventFieldDigitizerChildEventMask
};
enum {
kIOHIDEventFieldSwipeMask = IOHIDEventFieldBase(kIOHIDEventTypeSwipe),
kIOHIDEventFieldSwipeMotion,
kIOHIDEventFieldSwipeProgress,
kIOHIDEventFieldSwipePositionX,
kIOHIDEventFieldSwipePositionY,
kIOHIDEventFieldSwipeFlavor,
};
enum {
kIOHIDEventFieldNavigationSwipeMask = IOHIDEventFieldBase(kIOHIDEventTypeNavigationSwipe),
kIOHIDEventFieldNavigationSwipeMotion,
kIOHIDEventFieldNavigationSwipeProgress,
kIOHIDEventFieldNavigationSwipePositionX,
kIOHIDEventFieldNavigationSwipePositionY,
kIOHIDEventFieldNavagationSwipeFlavor,
};
enum {
kIOHIDEventFieldDockSwipeMask = IOHIDEventFieldBase(kIOHIDEventTypeDockSwipe),
kIOHIDEventFieldDockSwipeMotion,
kIOHIDEventFieldDockSwipeProgress,
kIOHIDEventFieldDockSwipePositionX,
kIOHIDEventFieldDockSwipePositionY,
kIOHIDEventFieldDockSwipeFlavor,
};
enum {
kIOHIDEventFieldFluidTouchGestureMask = IOHIDEventFieldBase(kIOHIDEventTypeFluidTouchGesture),
kIOHIDEventFieldFluidTouchGestureMotion,
kIOHIDEventFieldFluidTouchGestureProgress,
kIOHIDEventFieldFluidTouchGesturePositionX,
kIOHIDEventFieldFluidTouchGesturePositionY,
kIOHIDEventFieldFluidTouchGestureFlavor,
};
enum {
kIOHIDEventFieldBoundaryScrollMask = IOHIDEventFieldBase(kIOHIDEventTypeBoundaryScroll),
kIOHIDEventFieldBoundaryScrollMotion,
kIOHIDEventFieldBoundaryScrollProgress,
kIOHIDEventFieldBoundaryScrollPositionX,
kIOHIDEventFieldBoundaryScrollPositionY,
kIOHIDEventFieldBoundaryScrollFlavor,
};
enum {
kIOHIDEventFieldProgressEventType = IOHIDEventFieldBase(kIOHIDEventTypeProgress),
kIOHIDEventFieldProgressLevel,
};
enum {
kIOHIDEventFieldSymbolicHotKeyValue = IOHIDEventFieldBase(kIOHIDEventTypeSymbolicHotKey),
kIOHIDEventFieldSymbolicHotKeyIsCGSEvent,
};
/*!
@typedef IOHIDPowerType
@abstract Type of Power event triggered.
@discussion
@constant kIOHIDPowerTypePower
@constant kIOHIDPowerTypeCurrent
@constant kIOHIDPowerTypeVoltage
*/
enum {
kIOHIDPowerTypePower = 0,
kIOHIDPowerTypeCurrent = 1,
kIOHIDPowerTypeVoltage = 2
};
typedef uint32_t IOHIDPowerType;
/*!
@typedef IOHIDPowerSubType
@abstract Reserved
@discussion
@constant kIOHIDPowerSubTypeNormal
*/
enum {
kIOHIDPowerSubTypeNormal = 0
};
typedef uint32_t IOHIDPowerSubType;
enum {
kIOHIDEventFieldPowerMeasurement = IOHIDEventFieldBase(kIOHIDEventTypePower),
kIOHIDEventFieldPowerType,
kIOHIDEventFieldPowerSubType,
};
enum {
kIOHIDEventFieldBrightnessLevel = IOHIDEventFieldBase(kIOHIDEventTypeBrightness),
};
typedef uint32_t IOHIDEventField;
/*!
@typedef IOHIDSwipeMask
@abstract Mask detailing the type of swipe detected.
@discussion
@constant kIOHIDSwipeUp
@constant kIOHIDSwipeDown
@constant kIOHIDSwipeLeft
@constant kIOHIDSwipeRight
*/
enum {
kIOHIDSwipeNone = 0x00000000,
kIOHIDSwipeUp = 0x00000001,
kIOHIDSwipeDown = 0x00000002,
kIOHIDSwipeLeft = 0x00000004,
kIOHIDSwipeRight = 0x00000008,
kIOHIDScaleExpand = 0x00000010,
kIOHIDScaleContract = 0x00000020,
kIOHIDRotateCW = 0x00000040,
kIOHIDRotateCCW = 0x00000080,
};
typedef uint32_t IOHIDSwipeMask;
/*!
@typedef IOHIDGestureMotion
@abstract
@constant kIOHIDGestureMotionNone
@constant kIOHIDGestureMotionHorizontalX
@constant kIOHIDGestureMotionVerticalY
@constant kIOHIDGestureMotionScale
@constant kIOHIDGestureMotionRotate
@constant kIOHIDGestureMotionTap
@constant kIOHIDGestureMotionDoubleTap
@constant kIOHIDGestureMotionFromLeftEdge
@constant kIOHIDGestureMotionOffLeftEdge
@constant kIOHIDGestureMotionFromRightEdge
@constant kIOHIDGestureMotionOffRightEdge
@constant kIOHIDGestureMotionFromTopEdge
@constant kIOHIDGestureMotionOffTopEdge
@constant kIOHIDGestureMotionFromBottomEdge
@constant kIOHIDGestureMotionOffBottomEdge
*/
enum {
kIOHIDGestureMotionNone,
kIOHIDGestureMotionHorizontalX,
kIOHIDGestureMotionVerticalY,
kIOHIDGestureMotionScale,
kIOHIDGestureMotionRotate,
kIOHIDGestureMotionTap,
kIOHIDGestureMotionDoubleTap,
kIOHIDGestureMotionFromLeftEdge,
kIOHIDGestureMotionOffLeftEdge,
kIOHIDGestureMotionFromRightEdge,
kIOHIDGestureMotionOffRightEdge,
kIOHIDGestureMotionFromTopEdge,
kIOHIDGestureMotionOffTopEdge,
kIOHIDGestureMotionFromBottomEdge,
kIOHIDGestureMotionOffBottomEdge,
};
typedef uint16_t IOHIDGestureMotion;
/*!
@typedef IOHIDGestureFlavor
@abstract
@constant kIOHIDGestureFlavorNone
@constant kIOHIDGestureFlavorNotificationCenterPrimary
@constant kIOHIDGestureFlavorNotificationCenterSecondary
@constant kIOHIDGestureFlavorDockPrimary
@constant kIOHIDGestureFlavorDockSecondary
@constant kIOHIDGestureFlavorNavagationPrimary
@constant kIOHIDGestureFlavorNavagationSecondary
*/
enum {
kIOHIDGestureFlavorNone,
kIOHIDGestureFlavorNotificationCenterPrimary,
kIOHIDGestureFlavorNotificationCenterSecondary,
kIOHIDGestureFlavorDockPrimary,
kIOHIDGestureFlavorDockSecondary,
kIOHIDGestureFlavorNavagationPrimary,
kIOHIDGestureFlavorNavagationSecondary,
};
typedef uint16_t IOHIDGestureFlavor;
/*!
@typedef IOHIDProximityDetectionMask
@abstract Proximity mask detailing the inputs that were detected.
@discussion
@constant kIOHIDProximityDetectionLargeBodyContact
@constant kIOHIDProximityDetectionLargeBodyFarField
@constant kIOHIDProximityDetectionIrregularObjects
@constant kIOHIDProximityDetectionEdgeStraddling
@constant kIOHIDProximityDetectionFlatFingerClasp
@constant kIOHIDProximityDetectionFingerTouch
@constant kIOHIDProximityDetectionReceiver
@constant kIOHIDProximityDetectionSmallObjectsHovering
@constant kIOHIDProximityDetectionReceiverCrude
@constant kIOHIDProximityDetectionReceiverMonitoring
*/
enum {
kIOHIDProximityDetectionLargeBodyContact = 0x0001,
kIOHIDProximityDetectionLargeBodyFarField = 0x0002,
kIOHIDProximityDetectionIrregularObjects = 0x0004,
kIOHIDProximityDetectionEdgeStraddling = 0x0008,
kIOHIDProximityDetectionFlatFingerClasp = 0x0010,
kIOHIDProximityDetectionFingerTouch = 0x0020,
kIOHIDProximityDetectionReceiver = 0x0040,
kIOHIDProximityDetectionSmallObjectsHovering = 0x0080,
kIOHIDProximityDetectionReceiverCrude = 0x0100,
kIOHIDProximityDetectionReceiverMonitoring = 0x0200
};
typedef uint32_t IOHIDProximityDetectionMask;
/*!
@typedef IOHIDDigitizerType
@abstract The type of digitizer path initiating an event.
@discussion The IOHIDDigitizerType usually corresponds to the Logical Collection usage defined in Digitizer Usage Page (0x0d) of the USB HID Usage Tables.
@constant kIOHIDDigitizerTypeStylus
@constant kIOHIDDigitizerTypePuck
@constant kIOHIDDigitizerTypeFinger
*/
enum {
kIOHIDDigitizerTransducerTypeStylus = 0x20,
kIOHIDDigitizerTransducerTypePuck,
kIOHIDDigitizerTransducerTypeFinger,
kIOHIDDigitizerTransducerTypeHand
};
typedef uint32_t IOHIDDigitizerTransducerType;
/*!
@typedef IOHIDDigitizerEventMask
@abstract Event mask detailing the events being dispatched by a digitizer.
@discussion It is possible for digitizer events to contain child digitizer events, effectively, behaving as collections.
In the collection case, the child event mask field referrence by kIOHIDEventFieldDigitizerChildEventMask will detail the
cumulative event state of the child digitizer events.
<br>
<b>Please Note:</b>
If you append a child digitizer event to a parent digitizer event, appropriate state will be transfered on to the parent.
@constant kIOHIDDigitizerEventRange Issued when the range state has changed.
@constant kIOHIDDigitizerEventTouch Issued when the touch state has changed.
@constant kIOHIDDigitizerEventPosition Issued when the position has changed.
@constant kIOHIDDigitizerEventStop Issued when motion has achieved a state of calculated non-movement.
@constant kIOHIDDigitizerEventPeak Issues when new maximum values have been detected.
@constant kIOHIDDigitizerEventIdentity Issued when the identity has changed.
@constant kIOHIDDigitizerEventAttribute Issued when an attribute has changed.
@constant kIOHIDDigitizerEventUpSwipe Issued when an up swipe has been detected.
@constant kIOHIDDigitizerEventDownSwipe Issued when an down swipe has been detected.
@constant kIOHIDDigitizerEventLeftSwipe Issued when an left swipe has been detected.
@constant kIOHIDDigitizerEventRightSwipe Issued when an right swipe has been detected.
@constant kIOHIDDigitizerEventSwipeMask Mask used to gather swipe events.
*/
enum {
kIOHIDDigitizerEventRange = 0x00000001,
kIOHIDDigitizerEventTouch = 0x00000002,
kIOHIDDigitizerEventPosition = 0x00000004,
kIOHIDDigitizerEventStop = 0x00000008,
kIOHIDDigitizerEventPeak = 0x00000010,
kIOHIDDigitizerEventIdentity = 0x00000020,
kIOHIDDigitizerEventAttribute = 0x00000040,
kIOHIDDigitizerEventCancel = 0x00000080,
kIOHIDDigitizerEventStart = 0x00000100,
kIOHIDDigitizerEventResting = 0x00000200,
kIOHIDDigitizerEventSwipeUp = 0x01000000,
kIOHIDDigitizerEventSwipeDown = 0x02000000,
kIOHIDDigitizerEventSwipeLeft = 0x04000000,
kIOHIDDigitizerEventSwipeRight = 0x08000000,
kIOHIDDigitizerEventSwipeMask = 0xFF000000,
};
typedef uint32_t IOHIDDigitizerEventMask;
enum {
kIOHIDEventOptionNone = 0x00000000,
kIOHIDEventOptionIsAbsolute = 0x00000001,
kIOHIDEventOptionIsCollection = 0x00000002,
kIOHIDEventOptionPixelUnits = 0x00000004
};
typedef uint32_t IOHIDEventOptionBits;
enum {
kIOHIDEventPhaseUndefined = 0x00,
kIOHIDEventPhaseBegan = 0x01,
kIOHIDEventPhaseChanged = 0x02,
kIOHIDEventPhaseEnded = 0x04,
kIOHIDEventPhaseCancelled = 0x08,
kIOHIDEventPhaseMayBegin = 0x80,
kIOHIDEventEventPhaseMask = 0xFF,
kIOHIDEventEventOptionPhaseShift = 24,
};
typedef uint16_t IOHIDEventPhaseBits;
/*!
@typedef IOHIDSymbolicHotKey
@abstract Enumerted values for sending symbolic hot key events.
@constant kIOHIDSymbolicHotKeyDictionaryApp This will get translated into a kCGSDictionaryAppHotKey by CG.
@constant kIOHIDSymbolicHotKeyOptionIsCGSHotKey
This is an option flag to denote that the SymbolicHotKey value is
actually from the enumeration in CGSHotKeys.h.
*/
enum {
kIOHIDSymbolicHotKeyUndefined,
kIOHIDSymbolicHotKeyDictionaryApp,
};
typedef uint32_t IOHIDSymbolicHotKeyValue;
enum {
kIOHIDEventSenderIDUndefined = 0x0000000000000000LL,
};
typedef uint64_t IOHIDEventSenderID; // must be the same size as that returned from IORegistryEntry::getRegistryEntryID
#ifndef KERNEL
/*!
@typedef IOHIDFloat
*/
#ifdef __LP64__
typedef double IOHIDFloat;
#else
typedef float IOHIDFloat;
#endif
/*!
@typedef IOHID3DPoint
*/
typedef struct _IOHID3DPoint {
IOHIDFloat x;
IOHIDFloat y;
IOHIDFloat z;
} IOHID3DPoint;
#endif
#endif /* _IOKIT_HID_IOHIDEVENTTYPES_H } */

File diff suppressed because it is too large Load Diff