#include <IOKit/hidsystem/IOHIKeyboardMapper.h>
IOKit/hidsystem/IOHIKeyboardMapper.h
Key ip/down state is tracked in a bit list. Bits are set
for key-down, and cleared for key-up. The bit vector and macros
for it's manipulation are defined here.
typedefkbdBitVector
typedef UInt32 * kbdBitVector
macroEVK_BITS_PER_UNIT
#define EVK_BITS_PER_UNIT 32
macroEVK_BITS_MASK
#define EVK_BITS_MASK 31
macroEVK_KEYDOWN
#define EVK_KEYDOWN(n, bits) (bits)[((n)>>EVK_BITS_SHIFT)] |= (1 << ((n) & EVK_BITS_MASK))
macroEVK_KEYUP
#define EVK_KEYUP(n, bits) (bits)[((n)>>EVK_BITS_SHIFT)] &= ~(1 << ((n) & EVK_BITS_MASK))
macroEVK_IS_KEYDOWN
#define EVK_IS_KEYDOWN(n, bits) (((bits)[((n)>>EVK_BITS_SHIFT)] & (1 << ((n) & EVK_BITS_MASK))) != 0)
macrokMAX_MODIFIERS
the maximum number of modifier keys sticky keys can hold at once
#define kMAX_MODIFIERS 5
macrokNUM_SHIFTS_TO_ACTIVATE
the number of shift keys in a row that must be depressed to toggle state
#define kNUM_SHIFTS_TO_ACTIVATE 5
macrokDEFAULT_SHIFTEXPIREINTERVAL
the number of milliseconds all the shifts must be pressed in - 30 seconds (30000 mS)
#define kDEFAULT_SHIFTEXPIREINTERVAL 30000
enum(anonymous)
sticky keys state flags
| kState_Disabled_Flag | 1 | disabled and will do nothing until this is changed |
| kState_ShiftActivates_Flag | 2 | the 'on' gesture (5 shifts) will activate |
| kState_On | 4 | currently on, will hold down modifiers when pressed |
| kState_On_ModifiersDown | 8 | one or more modifiers being held down |
| kState_Mask | 255 | mask for all states |
struct_stickyKeys_ToggleInfo
| IOByteCount | size | size of this allocation |
| unsigned int | toggleModifier | which modifier key we are tracking (using NX_WHICHMODMASK) |
| unsigned int | repetitionsToToggle | the number of times the modifier must be pressed to toggle |
| AbsoluteTime | expireInterval | how long the user has to press the modifier repetitionsToToggle times the default is 30 seconds |
| unsigned int | currentCount | the number of times the modifier used within the alloted time |
| AbsoluteTime[1] | deadlines | the times that the last shift must occer for this one to be used this array will actually be of size repetitionsToToggle |
typedefStickyKeys_ToggleInfo
typedef struct _stickyKeys_ToggleInfo StickyKeys_ToggleInfo;
enum(anonymous)
Flags for each sticky key modifier
This will allow for chording of keys
and for key locking
| kModifier_DidPerformModifiy | 1 | |
| kModifier_DidKeyUp | 2 | |
| kModifier_Locked | 4 |
struct_stickyKeys_ModifierInfo
| UInt8 | key | Key code of the sticky modifier |
| UInt8 | state | The state of the sticky modifier |
| UInt8 | leftModBit | System Mod bit of the sticky modifier |
typedefStickyKeys_ModifierInfo
typedef struct _stickyKeys_ModifierInfo StickyKeys_ModifierInfo;