feat: handle new EventData
parent
0239374b0c
commit
96985e0a2c
|
@ -16,6 +16,7 @@ pub enum NativeEventType {
|
||||||
pub struct NativeEvent {
|
pub struct NativeEvent {
|
||||||
pub time: usize,
|
pub time: usize,
|
||||||
pub event_type: NativeEventType,
|
pub event_type: NativeEventType,
|
||||||
|
pub label: u16,
|
||||||
pub key: u16,
|
pub key: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,14 +42,16 @@ pub extern "C" fn start_hook(callback: extern "C" fn(NativeEvent)) -> *const c_c
|
||||||
|
|
||||||
if let Err(e) = skyhook::run(move |event| {
|
if let Err(e) = skyhook::run(move |event| {
|
||||||
let event = match event.data {
|
let event = match event.data {
|
||||||
skyhook::types::EventData::KeyPress(key) => NativeEvent {
|
skyhook::types::EventData::KeyPress(label, key) => NativeEvent {
|
||||||
time: get_time(event.time),
|
time: get_time(event.time),
|
||||||
event_type: NativeEventType::KeyPressed,
|
event_type: NativeEventType::KeyPressed,
|
||||||
|
label: label as u16,
|
||||||
key,
|
key,
|
||||||
},
|
},
|
||||||
skyhook::types::EventData::KeyRelease(key) => NativeEvent {
|
skyhook::types::EventData::KeyRelease(label, key) => NativeEvent {
|
||||||
time: get_time(event.time),
|
time: get_time(event.time),
|
||||||
event_type: NativeEventType::KeyReleased,
|
event_type: NativeEventType::KeyReleased,
|
||||||
|
label: label as u16,
|
||||||
key,
|
key,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7f8737e4ee52f53b954c6e656fe266aca147fdb5
|
Subproject commit 4e7ad264aac51c8ddee24c1f808fd88a4dc09dc0
|
Reference in New Issue