1/* 2 * @APPLE_LICENSE_HEADER_START@ 3 * 4 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. 24 * 25 * evsio.h - Get/Set parameter calls for Event Status Driver. 26 * 27 * CAUTION: Developers should stick to the API exported in 28 * <drivers/event_status_driver.h> to guarantee 29 * binary compatability of their applications in future 30 * releases. 31 * 32 * HISTORY 33 * 22 May 1992 Mike Paquette at NeXT 34 * Created. 35 */ 36#ifndef _DEV_EVSIO_H 37#define _DEV_EVSIO_H 38 39/* Public type definitions. */ 40#include <IOKit/hidsystem/IOHIDTypes.h> 41#include <IOKit/hidsystem/IOLLEvent.h> 42 43/* 44 * Identify this driver as one that uses the new driverkit and messaging API 45 */ 46#ifndef _NeXT_MACH_EVENT_DRIVER_ 47#define _NeXT_MACH_EVENT_DRIVER_ (1) 48#endif /* !_NeXT_MACH_EVENT_DRIVER_ */ 49 50/* * */ 51 52#define kIOHIDKindKey "HIDKind" 53#define kIOHIDInterfaceIDKey "HIDInterfaceID" 54#define kIOHIDSubinterfaceIDKey "HIDSubinterfaceID" 55#define kIOHIDOriginalSubinterfaceIDKey "HIDOriginalSubinterfaceID" 56 57#define kIOHIDParametersKey "HIDParameters" 58 59#define kIOHIDVirtualHIDevice "HIDVirtualDevice" 60 61#define kIOHIDKeyRepeatKey "HIDKeyRepeat" 62#define kIOHIDInitialKeyRepeatKey "HIDInitialKeyRepeat" 63#define kIOHIDKeyMappingKey "HIDKeyMapping" 64#define kIOHIDResetKeyboardKey "HIDResetKeyboard" 65 66#define kIOHIDKeyboardModifierMappingPairsKey "HIDKeyboardModifierMappingPairs" 67#define kIOHIDKeyboardModifierMappingSrcKey "HIDKeyboardModifierMappingSrc" 68#define kIOHIDKeyboardModifierMappingDstKey "HIDKeyboardModifierMappingDst" 69 70#define kIOHIDKeyboardCapsLockDoesLockKey "HIDKeyboardCapsLockDoesLock" 71#define kIOHIDKeyboardSupportsF12EjectKey "HIDKeyboardSupportsF12Eject" 72#define kIOHIDKeyboardSupportedModifiersKey "HIDKeyboardSupportedModifiers" 73 74#define kIOHIDPointerResolutionKey "HIDPointerResolution" 75#define kIOHIDResetPointerKey "HIDResetPointer" 76#define kIOHIDPointerConvertAbsoluteKey "HIDPointerConvertAbsolute" 77#define kIOHIDPointerContactToMoveKey "HIDPointerContactToMove" 78#define kIOHIDPointerPressureToClickKey "HIDPointerPressureToClick" 79#define kIOHIDPointerButtonMode "HIDPointerButtonMode" 80#define kIOHIDPointerButtonCountKey "HIDPointerButtonCount" 81 82#define kIOHIDPointerAccelerationKey "HIDPointerAcceleration" 83#define kIOHIDPointerAccelerationSettingsKey "HIDPointerAccelerationSettings" 84#define kIOHIDPointerAccelerationTypeKey "HIDPointerAccelerationType" 85#define kIOHIDPointerAccelerationTableKey "HIDPointerAccelerationTable" 86 87#define kIOHIDScrollResetKey "HIDScrollReset" 88#define kIOHIDScrollResolutionKey "HIDScrollResolution" 89#define kIOHIDScrollReportRateKey "HIDScrollReportRate" 90#define kIOHIDScrollAccelerationKey "HIDScrollAcceleration" 91#define kIOHIDScrollAccelerationTypeKey "HIDScrollAccelerationType" 92#define kIOHIDScrollAccelerationTableKey "HIDScrollAccelerationTable" 93 94#define kIOHIDScrollResolutionXKey "HIDScrollResolutionX" 95#define kIOHIDScrollResolutionYKey "HIDScrollResolutionY" 96#define kIOHIDScrollResolutionZKey "HIDScrollResolutionZ" 97 98#define kIOHIDScrollAccelerationTableXKey "HIDScrollAccelerationTableX" 99#define kIOHIDScrollAccelerationTableYKey "HIDScrollAccelerationTableY" 100#define kIOHIDScrollAccelerationTableZKey "HIDScrollAccelerationTableZ" 101 102#define kIOHIDScrollMouseButtonKey "HIDScrollMouseButton" 103 104#define kIOHIDScrollZoomModifierMaskKey "HIDScrollZoomModifierMask" 105 106#define kIOHIDTrackpadScrollAccelerationKey "HIDTrackpadScrollAcceleration" 107#define kIOHIDMouseScrollAccelerationKey "HIDMouseScrollAcceleration" 108 109#define kIOHIDTrackpadAccelerationType "HIDTrackpadAcceleration" 110#define kIOHIDMouseAccelerationType "HIDMouseAcceleration" 111 112#define kIOHIDClickTimeKey "HIDClickTime" 113#define kIOHIDClickSpaceKey "HIDClickSpace" 114 115#define kIOHIDWaitCursorFrameIntervalKey "HIDWaitCursorFrameInterval" 116 117#define kIOHIDAutoDimThresholdKey "HIDAutoDimThreshold" 118#define kIOHIDAutoDimStateKey "HIDAutoDimState" 119#define kIOHIDAutoDimTimeKey "HIDAutoDimTime" 120#define kIOHIDIdleTimeKey "HIDIdleTime" 121 122#define kIOHIDBrightnessKey "HIDBrightness" 123#define kIOHIDAutoDimBrightnessKey "HIDAutoDimBrightness" 124 125#define kIOHIDFKeyModeKey "HIDFKeyMode" 126 127// if kIOHIDStickyKeysDisabledKey is 1, then all sticky keys functionality 128// is completely turned off. Multiple shifts will have no effect. 129#define kIOHIDStickyKeysDisabledKey "HIDStickyKeysDisabled" 130 131// if kIOHIDStickyKeysOnKey is 1 then a depressed modifier will stay down 132// until a non-modifer key is pressed (or sticky keys is turned off) 133#define kIOHIDStickyKeysOnKey "HIDStickyKeysOn" 134 135// if kIOHIDStickyKeysShiftTogglesKey is 1, then a sequence of five 136// shift keys in sequence will toggle sticky keys on or off 137#define kIOHIDStickyKeysShiftTogglesKey "HIDStickyKeysShiftToggles" 138 139// if kIOHIDMouseKeysOptionTogglesKey is 1, then a sequence of five 140// option keys in sequence will toggle mouse keys on or off 141#define kIOHIDMouseKeysOptionTogglesKey "HIDMouseKeysOptionToggles" 142 143// kIOHIDSlowKeysDelayKey represents the delay used for slow keys. 144// if kIOHIDSlowKeysDelayKey is 0, then slow keys off 145#define kIOHIDSlowKeysDelayKey "HIDSlowKeysDelay" 146 147#define kIOHIDF12EjectDelayKey "HIDF12EjectDelay" 148 149#define kIOHIDMouseKeysOnKey "HIDMouseKeysOn" 150 151#define kIOHIDUseKeyswitchKey "HIDUseKeyswitch" 152 153#define kIOHIDDisallowRemappingOfPrimaryClickKey "HIDDisallowRemappingOfPrimaryClick" 154#define kIOHIDMouseKeysEnablesVirtualNumPadKey "HIDMouseKeysEnablesVirtualNumPad" 155 156#define kIOHIDResetLEDsKey "HIDResetLEDs" 157 158// Parametric Acceleration Keys 159#define kHIDAccelParametricCurvesKey "HIDAccelCurves" 160#define kHIDTrackingAccelParametricCurvesKey "HIDTrackingAccelCurves" 161#define kHIDScrollAccelParametricCurvesKey "HIDScrollAccelCurves" 162#define kHIDAccelParametricCurvesDebugKey "HIDAccelCurvesDebug" 163#define kHIDScrollAccelParametricCurvesDebugKey "HIDScrollAccelCurvesDebug" 164#define kHIDAccelGainLinearKey "HIDAccelGainLinear" 165#define kHIDAccelGainParabolicKey "HIDAccelGainParabolic" 166#define kHIDAccelGainCubicKey "HIDAccelGainCubic" 167#define kHIDAccelGainQuarticKey "HIDAccelGainQuartic" 168#define kHIDAccelTangentSpeedLinearKey "HIDAccelTangentSpeedLinear" 169#define kHIDAccelTangentSpeedParabolicRootKey "HIDAccelTangentSpeedParabolicRoot" 170#define kHIDAccelTangentSpeedCubicRootKey "HIDAccelTangentSpeedCubicRoot" 171#define kHIDAccelTangentSpeedQuarticRootKey "HIDAccelTangentSpeedQuarticRoot" 172#define kHIDAccelIndexKey "HIDAccelIndex" 173 174// Scroll Count Keys 175#define kIOHIDScrollCountMaxTimeDeltaBetweenKey "HIDScrollCountMaxTimeDeltaBetween" 176#define kIOHIDScrollCountMaxTimeDeltaToSustainKey "HIDScrollCountMaxTimeDeltaToSustain" 177#define kIOHIDScrollCountMinDeltaToStartKey "HIDScrollCountMinDeltaToStart" 178#define kIOHIDScrollCountMinDeltaToSustainKey "HIDScrollCountMinDeltaToSustain" 179#define kIOHIDScrollCountIgnoreMomentumScrollsKey "HIDScrollCountIgnoreMomentumScrolls" 180#define kIOHIDScrollCountMouseCanResetKey "HIDScrollCountMouseCanReset" 181#define kIOHIDScrollCountMaxKey "HIDScrollCountMax" 182#define kIOHIDScrollCountAccelerationFactorKey "HIDScrollCountAccelerationFactor" 183#define kIOHIDScrollCountZeroKey "HIDScrollCountZero" 184#define kIOHIDScrollCountBootDefaultKey "HIDScrollCountBootDefault" 185#define kIOHIDScrollCountResetKey "HIDScrollCountReset" 186 187// the following values are used in kIOHIDPointerButtonMode 188typedef enum { 189 kIOHIDButtonMode_BothLeftClicks = 0, 190 kIOHIDButtonMode_ReverseLeftRightClicks = 1, 191 kIOHIDButtonMode_EnableRightClick = 2 192} IOHIDButtonModes; 193 194#ifdef _undef 195#define EVS_PREFIX "Evs_" /* All EVS calls start with this string */ 196 197/* WaitCursor-related ioctls */ 198 199#define EVSIOSWT "Evs_SetWaitThreshold" 200#define EVSIOSWT_SIZE EVS_PACKED_TIME_SIZE 201 202#define EVSIOSWS "Evs_SetWaitSustain" 203#define EVSIOSWS_SIZE EVS_PACKED_TIME_SIZE 204 205#define EVSIOSWFI "Evs_SetWaitFrameInterval" 206#define EVSIOSWFI_SIZE EVS_PACKED_TIME_SIZE 207 208#define EVSIOCWINFO "Evs_CurrentWaitCursorInfo" 209#define EVSIOCWINFO_THRESH 0 210#define EVSIOCWINFO_SUSTAIN (EVSIOCWINFO_THRESH + EVS_PACKED_TIME_SIZE) 211#define EVSIOCWINFO_FINTERVAL (EVSIOCWINFO_SUSTAIN + EVS_PACKED_TIME_SIZE) 212#define EVSIOCWINFO_SIZE (EVSIOCWINFO_FINTERVAL + EVS_PACKED_TIME_SIZE) 213#endif 214 215#define EVS_PACKED_TIME_SIZE (sizeof(UInt64) / sizeof( unsigned int)) 216 217/* Device control ioctls. Levels specified may be in the range 0 - 64. */ 218 219#define EVSIOSB kIOHIDBrightnessKey 220#define EVSIOSB_SIZE 1 221 222#define EVSIOSADB kIOHIDAutoDimBrightnessKey 223#define EVSIOSADB_SIZE 1 224 225#ifdef _undef 226#define EVSIOSA "Evs_SetAttenuation" 227#define EVIOSA_SIZE 1 228 229#define EVSIO_DCTLINFO "Evs_DeviceControlInfo" 230typedef enum { 231 EVSIO_DCTLINFO_BRIGHT, 232 EVSIO_DCTLINFO_ATTEN, 233 EVSIO_DCTLINFO_AUTODIMBRIGHT 234} evsio_DCTLINFOIndices; 235#define EVSIO_DCTLINFO_SIZE (EVSIO_DCTLINFO_AUTODIMBRIGHT + 1) 236#endif 237 238/* 239 * Device status request 240 */ 241#define EVSIOINFO NX_EVS_DEVICE_INFO 242 243 244/* Keyboard-related ioctls - implemented within Event Sources */ 245 246#define EVSIOSKR kIOHIDKeyRepeatKey 247#define EVSIOSKR_SIZE EVS_PACKED_TIME_SIZE 248 249#define EVSIOSIKR kIOHIDInitialKeyRepeatKey 250#define EVSIOSIKR_SIZE EVS_PACKED_TIME_SIZE 251 252#define EVSIORKBD kIOHIDResetKeyboardKey 253#define EVSIORKBD_SIZE 1 254 255#define EVSIOCKR_SIZE EVS_PACKED_TIME_SIZE 256 257#define EVSIOCKML kIOHIDKeyMappingKey 258#define EVSIOCKML_SIZE 1 259 260/* The following two tokens are for use with the get/set character routines. */ 261#define EVSIOSKM kIOHIDKeyMappingKey 262#define EVSIOSKM_SIZE 4096 263 264#define EVSIOCKM kIOHIDKeyMappingKey 265#define EVSIOCKM_SIZE 4096 266 267/* Mouse-related ioctls - implemented within Event Sources */ 268 269#define EVSIOSMS kIOHIDPointerAccelerationKey 270#define EVSIOSMS_SIZE (1) 271 272#define EVSIOCMS kIOHIDPointerAccelerationKey 273#define EVSIOCMS_SIZE (1) 274 275#ifdef _undef 276#define EVSIOSMH "Evs_SetMouseHandedness" 277#define EVSIOSMH_SIZE 1 // value from NXMouseButton enum 278 279#define EVSIOCMH "Evs_CurrentMouseHandedness" 280#define EVSIOCMH_SIZE 1 281#endif 282 283/* Generic pointer device controls, implemented by the Event Driver. */ 284#define EVSIOSCT kIOHIDClickTimeKey 285#define EVSIOSCT_SIZE EVS_PACKED_TIME_SIZE 286 287#define EVSIOSCS kIOHIDClickSpaceKey 288typedef enum { 289 EVSIOSCS_X, 290 EVSIOSCS_Y 291} evsioEVSIOSCSIndices; 292#define EVSIOSCS_SIZE (EVSIOSCS_Y + 1) 293 294#define EVSIOSADT kIOHIDAutoDimThresholdKey 295#define EVSIOSADT_SIZE EVS_PACKED_TIME_SIZE 296 297#define EVSIOSADS kIOHIDAutoDimStateKey 298#define EVSIOSADS_SIZE 1 299 300#define EVSIORMS kIOHIDResetPointerKey 301#define EVSIORMS_SIZE 1 302 303#define EVSIOCCT kIOHIDClickTimeKey 304#define EVSIOCCT_SIZE EVS_PACKED_TIME_SIZE 305 306#define EVSIOCADT kIOHIDAutoDimThresholdKey 307#define EVSIOCADT_SIZE EVS_PACKED_TIME_SIZE 308 309#define EVSIOGDADT kIOHIDAutoDimTimeKey 310#define EVSIOGDADT_SIZE EVS_PACKED_TIME_SIZE 311 312#define EVSIOIDLE kIOHIDIdleTimeKey 313#define EVSIOIDLE_SIZE EVS_PACKED_TIME_SIZE 314 315#define EVSIOCCS kIOHIDClickSpaceKey 316typedef enum { 317 EVSIOCCS_X, 318 EVSIOCCS_Y 319} evsioEVSIOCCSIndices; 320#define EVSIOCCS_SIZE (EVSIOCCS_Y + 1) 321 322#define EVSIOCADS kIOHIDAutoDimStateKey 323#define EVSIOCADS_SIZE 1 324 325enum { 326 // Selectors for IOHIDGetModifierLockState and IOHIDSetModifierLockState 327 kIOHIDCapsLockState = 0x00000001, 328 kIOHIDNumLockState = 0x00000002, 329 kIOHIDActivityUserIdle = 0x00000003, 330 kIOHIDActivityDisplayOn = 0x00000004, 331}; 332 333#endif /* !_DEV_EVSIO_H */ 334