IOHIDEventSystemTestController.h [plain text]
#import <Foundation/Foundation.h>
#include <IOKit/hid/IOHIDEventSystemClient.h>
typedef struct _EVENTS_STATS {
uint32_t counts[kIOHIDEventTypeCount];
uint64_t minLatency;
uint64_t maxLatency;
uint64_t averageLatency;
uint32_t totalCount;
} EVENTS_STATS;
@protocol IOHIDEventObserver <NSObject>
-(void) EventCallback: (nonnull IOHIDEventRef) event For: (nullable IOHIDServiceClientRef) service;
@optional
-(BOOL) FilterCallback: (nonnull IOHIDEventRef) event For: (nullable IOHIDServiceClientRef) service;
@end
@protocol IOHIDPropertyObserver <NSObject>
-(void) PropertyCallback: (nonnull CFStringRef) property And: (nullable CFTypeRef) value;
@end
@interface IOHIDEventSystemTestController : NSObject
@property (readonly, nonnull) IOHIDEventSystemClientRef eventSystemClient;
@property ( nullable) IOHIDServiceClientRef eventService;
@property (readonly, nullable) dispatch_queue_t eventSystemQueue;
@property ( nonnull) NSMutableArray* events;
@property ( nonnull) NSMutableArray* otherEvents;
@property NSInteger eventSystemResetCount;
@property (nonatomic,nullable) id<IOHIDEventObserver> eventObserver;
@property (nullable) NSMutableDictionary* propertyObservers;
-(nullable instancetype) initWithDeviceUniqueID: (nonnull id) uniqueID AndQueue:(nonnull dispatch_queue_t) queue;
-(nullable instancetype) initWithDeviceUniqueID: (nonnull id) uniqueID :(nonnull dispatch_queue_t) queue :(IOHIDEventSystemClientType) type;
-(nullable instancetype) initWithMatching: (nonnull NSDictionary *) matching AndQueue:(nonnull dispatch_queue_t) queue;
-(nullable instancetype) initWithMatching: (nonnull NSDictionary *) matching :(nonnull dispatch_queue_t) queue :(IOHIDEventSystemClientType) type;
+(EVENTS_STATS) getEventsStats : (nonnull NSArray *) events;
-(void)invalidate;
-(void) addPropertyObserver : (id <IOHIDPropertyObserver> _Nonnull) observer For:(NSString * _Nonnull) key;
-(void) removePropertyObserver : (id <IOHIDPropertyObserver> _Nonnull) observer For:(NSString * _Nonnull) key;
@end