1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
use std::os::raw::c_void;
use core_foundation_sys::array::CFArrayRef;
use core_foundation_sys::base::{CFAllocatorRef, CFTypeID, CFTypeRef};
use core_foundation_sys::dictionary::CFDictionaryRef;
use core_foundation_sys::runloop::CFRunLoopRef;
use core_foundation_sys::set::CFSetRef;
use core_foundation_sys::string::CFStringRef;
use base::Boolean;
use hid::base::{IOHIDDeviceCallback, IOHIDReportCallback, IOHIDValueCallback};
use ret::IOReturn;
use types::IOOptionBits;
pub type IOHIDManagerOptions = IOOptionBits;
pub const kIOHIDManagerOptionNone: IOHIDManagerOptions = 0x0;
pub const kIOHIDManagerOptionUsePersistentProperties: IOHIDManagerOptions = 0x1;
pub const kIOHIDManagerOptionDoNotLoadProperties: IOHIDManagerOptions = 0x2;
pub const kIOHIDManagerOptionDoNotSaveProperties: IOHIDManagerOptions = 0x4;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __IOHIDManager {
_unused: [u8; 0],
}
pub type IOHIDManagerRef = *mut __IOHIDManager;
extern "C" {
pub fn IOHIDManagerGetTypeID() -> CFTypeID;
pub fn IOHIDManagerCreate(
allocator: CFAllocatorRef,
options: IOHIDManagerOptions,
) -> IOHIDManagerRef;
pub fn IOHIDManagerOpen(manager: IOHIDManagerRef, options: IOHIDManagerOptions) -> IOReturn;
pub fn IOHIDManagerClose(manager: IOHIDManagerRef, options: IOHIDManagerOptions) -> IOReturn;
pub fn IOHIDManagerGetProperty(manager: IOHIDManagerRef, key: CFStringRef) -> CFTypeRef;
pub fn IOHIDManagerSetProperty(
manager: IOHIDManagerRef,
key: CFStringRef,
value: CFTypeRef,
) -> Boolean;
pub fn IOHIDManagerScheduleWithRunLoop(
manager: IOHIDManagerRef,
runLoop: CFRunLoopRef,
runLoopMode: CFStringRef,
);
pub fn IOHIDManagerUnscheduleFromRunLoop(
manager: IOHIDManagerRef,
runLoop: CFRunLoopRef,
runLoopMode: CFStringRef,
);
pub fn IOHIDManagerSetDeviceMatching(manager: IOHIDManagerRef, matching: CFDictionaryRef);
pub fn IOHIDManagerSetDeviceMatchingMultiple(manager: IOHIDManagerRef, multiple: CFArrayRef);
pub fn IOHIDManagerCopyDevices(manager: IOHIDManagerRef) -> CFSetRef;
pub fn IOHIDManagerRegisterDeviceMatchingCallback(
manager: IOHIDManagerRef,
callback: IOHIDDeviceCallback,
context: *mut c_void,
);
pub fn IOHIDManagerRegisterDeviceRemovalCallback(
manager: IOHIDManagerRef,
callback: IOHIDDeviceCallback,
context: *mut c_void,
);
pub fn IOHIDManagerRegisterInputReportCallback(
manager: IOHIDManagerRef,
callback: IOHIDReportCallback,
context: *mut c_void,
);
pub fn IOHIDManagerRegisterInputValueCallback(
manager: IOHIDManagerRef,
callback: IOHIDValueCallback,
context: *mut c_void,
);
pub fn IOHIDManagerSetInputValueMatching(manager: IOHIDManagerRef, matching: CFDictionaryRef);
pub fn IOHIDManagerSetInputValueMatchingMultiple(
manager: IOHIDManagerRef,
multiple: CFArrayRef,
);
pub fn IOHIDManagerSaveToPropertyDomain(
manager: IOHIDManagerRef,
applicationID: CFStringRef,
userName: CFStringRef,
hostName: CFStringRef,
options: IOOptionBits,
);
}