]>
git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/hidsystem/IOHIDTypes.h
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 /******************************************************************************
24 Data types for the events status driver.
25 This file contains public API.
28 Copyright 1991 NeXT Computer, Inc.
32 ******************************************************************************/
34 #ifndef _DEV_EV_TYPES_H
35 #define _DEV_EV_TYPES_H
37 #include <mach/boolean.h>
38 #include <IOKit/IOSharedLock.h>
39 #include <IOKit/graphics/IOGraphicsTypes.h>
41 /* Shared memory versions */
42 #define EVENT_SYSTEM_VERSION 2
44 /* Maximum length of SetMouseScaling arrays */
45 #define NX_MAXMOUSESCALINGS 20
47 typedef struct evsioKeymapping
/* Match old struct names in kernel */
53 typedef struct evsioMouseScaling
/* Match old struct names in kernel */
56 short scaleThresholds
[NX_MAXMOUSESCALINGS
];
57 short scaleFactors
[NX_MAXMOUSESCALINGS
];
67 * NXEventSystemInfo() information structures. These are designed to
68 * allow for expansion.
70 * The current implementation of NXEventSystemInfo() uses an ioctl call.
75 * Generic query max size and typedefs.
77 * The maximum size is selected to support anticipated future extensions
78 * of request flavors. Certain flavors planned for future releases may
79 * require roughtly 800 ints to represent. We allow a little extra, in
80 * case further growth is needed.
82 typedef int *NXEventSystemInfoType
;
83 #define NX_EVS_INFO_MAX (1024) /* Max array size */
84 typedef int NXEventSystemInfoData
[NX_EVS_INFO_MAX
];
86 /* Event System Devices query */
87 #define NX_EVS_DEVICE_MAX 16
90 #define NX_EVS_DEVICE_INTERFACE_OTHER 0
91 #define NX_EVS_DEVICE_INTERFACE_NeXT 1 // NeXT custom, in older sys
92 #define NX_EVS_DEVICE_INTERFACE_ADB 2 // NeXT/fruit keybds/mice
93 #define NX_EVS_DEVICE_INTERFACE_ACE 3 // For x86 PC keyboards
94 #define NX_EVS_DEVICE_INTERFACE_SERIAL_ACE 4 // For PC serial mice
95 #define NX_EVS_DEVICE_INTERFACE_BUS_ACE 5 // For PC bus mice
96 #define NX_EVS_DEVICE_INTERFACE_HIL 6 // For HIL hp keyboard
97 #define NX_EVS_DEVICE_INTERFACE_TYPE5 7 // For Sun Type5 keyboard
100 * Note! if any new interface types are added above, the following
101 * definition of the number of interfaces supported must reflect this.
102 * This is used in the libkeymap project (storemap.c module) which needs
103 * to be cognizant of the number of new devices coming online
104 * via support for heterogeneous architecture platforms.
105 * e.g., PCs, HP's HIL, Sun's Type5 keyboard,...
107 #define NUM_SUPPORTED_INTERFACES (NX_EVS_DEVICE_INTERFACE_TYPE5 + 1)
108 // Other, NeXT, ADB, ACE,...
111 #define NX_EVS_DEVICE_TYPE_OTHER 0
112 #define NX_EVS_DEVICE_TYPE_KEYBOARD 1
113 #define NX_EVS_DEVICE_TYPE_MOUSE 2 // Relative position devices
114 #define NX_EVS_DEVICE_TYPE_TABLET 3 // Absolute position devices
117 int interface
; /* NeXT, ADB, other */
118 int interface_addr
; /* Device address on the interface */
119 int dev_type
; /* Keyboard, mouse, tablet, other */
120 int id
; /* manufacturer's device handler ID */
121 } NXEventSystemDevice
;
124 NXEventSystemDevice dev
[NX_EVS_DEVICE_MAX
];
125 } NXEventSystemDeviceList
;
127 #define __OLD_NX_EVS_DEVICE_INFO 1
128 #define NX_EVS_DEVICE_INFO "Evs_EventDeviceInfo"
129 #define NX_EVS_DEVICE_INFO_COUNT \
130 (sizeof (NXEventSystemDeviceList) / sizeof (int))
133 * Types used in evScreen protocol compliant operations.
136 typedef enum {EVNOP
, EVHIDE
, EVSHOW
, EVMOVE
, EVLEVEL
} EvCmd
; /* Cursor state */
138 #define EV_SCREEN_MIN_BRIGHTNESS 0
139 #define EV_SCREEN_MAX_BRIGHTNESS 64
140 /* Scale should lie between MIN_BRIGHTNESS and MAX_BRIGHTNESS */
141 #define EV_SCALE_BRIGHTNESS( scale, datum ) \
142 ((((unsigned long)(datum))*((unsigned long)scale)) >> 6)
145 * Definition of a tick, as a time in milliseconds. This controls how
146 * often the event system periodic jobs are run. All actual tick times
147 * are derived from the nanosecond timer. These values are typically used
148 * as part of computing mouse velocity for acceleration purposes.
150 #define EV_TICK_TIME 16 /* 16 milliseconds */
151 #define EV_TICKS_PER_SEC (1000/EV_TICK_TIME) /* ~ 62 Hz */
153 /* Mouse Button bits, as passed from an EventSrc to the Event Driver */
156 #define EV_MOUSEBUTTONMASK (EV_LB | EV_RB)
158 /* Tablet Pressure Constants, as passed from an EventSrc to the Event Driver */
159 #define EV_MINPRESSURE 0
160 #define EV_MAXPRESSURE 255
162 /* Cursor size in pixels */
163 #define EV_CURSOR_WIDTH 16
164 #define EV_CURSOR_HEIGHT 16
167 #define kAppleOnboardGUID 0x0610000000000000ULL
169 #endif /* !_DEV_EV_TYPES_H */