Skip to main content

rusteal_core/
input.rs

1use rusteal_ffi::UObjectHandle;
2
3use crate::error::{RustealResult, check_ffi_ctx};
4use crate::ffi_dispatch;
5
6#[track_caller]
7pub fn bind_action_raw(
8    actor: UObjectHandle,
9    action: UObjectHandle,
10    trigger_event: u8,
11    function: &str,
12) -> RustealResult<()> {
13    check_ffi_ctx(
14        unsafe {
15            ffi_dispatch::input_bind_action(
16                actor,
17                action,
18                trigger_event,
19                function.as_ptr(),
20                function.len() as u32,
21            )
22        },
23        function,
24    )
25}
26
27pub fn should_display_touch_interface() -> bool {
28    unsafe { ffi_dispatch::input_should_display_touch_interface() }
29}