Skip to content

Commit 3153708

Browse files
committed
decent interpolation
1 parent faa51c9 commit 3153708

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@ impl SimConnector {
8888
}
8989
}
9090

91+
pub fn map_client_event_to_sim_event(&self, event_id: SIMCONNECT_CLIENT_EVENT_ID, event_name: &str) -> bool {
92+
unsafe {
93+
let result = SimConnect_MapClientEventToSimEvent(self.sim_connect_handle, event_id, as_c_string!(event_name));
94+
return result == 0;
95+
}
96+
}
97+
98+
pub fn transmit_client_event(&self, object_id: SIMCONNECT_OBJECT_ID, event_id: SIMCONNECT_CLIENT_EVENT_ID, dw_data: DWORD, group_id: SIMCONNECT_NOTIFICATION_GROUP_ID, flags: SIMCONNECT_EVENT_FLAG) -> bool{
99+
unsafe {
100+
let result = SimConnect_TransmitClientEvent(self.sim_connect_handle, object_id, event_id, dw_data, group_id, flags);
101+
return result == 0;
102+
}
103+
}
104+
91105
pub fn get_next_message(&self) -> Result<DispatchResult, &str> {
92106
let mut data_buf: *mut SIMCONNECT_RECV = ptr::null_mut();
93107

0 commit comments

Comments
 (0)