pub trait InputManagerServiceSyncHandler {
// Required methods
fn handle_get_connected_gamepads(&self) -> Result<Vec<GamepadInfo>>;
fn handle_set_gamepad_vibration(
&self,
device_id: String,
motor1_value: i8,
motor1_time: i8,
motor2_value: i8,
motor2_time: i8,
) -> Result<bool>;
fn handle_set_gamepad_light(
&self,
device_id: String,
r_value: i8,
g_value: i8,
b_value: i8,
) -> Result<bool>;
fn handle_set_ruyi_controller_status(
&self,
channel: i8,
enable_r: bool,
enable_g: bool,
enable_b: bool,
enable_motor1: bool,
enable_motor2: bool,
shutdown: bool,
r_value: i8,
g_value: i8,
b_value: i8,
motor1_value: i8,
motor1_time: i8,
motor2_value: i8,
motor2_time: i8,
) -> Result<bool>;
}Required Methods§
Sourcefn handle_get_connected_gamepads(&self) -> Result<Vec<GamepadInfo>>
fn handle_get_connected_gamepads(&self) -> Result<Vec<GamepadInfo>>
Get the gamepads that are connected corrently
Sourcefn handle_set_gamepad_vibration(
&self,
device_id: String,
motor1_value: i8,
motor1_time: i8,
motor2_value: i8,
motor2_time: i8,
) -> Result<bool>
fn handle_set_gamepad_vibration( &self, device_id: String, motor1_value: i8, motor1_time: i8, motor2_value: i8, motor2_time: i8, ) -> Result<bool>
Activate the vibration of gamepad
Sourcefn handle_set_gamepad_light(
&self,
device_id: String,
r_value: i8,
g_value: i8,
b_value: i8,
) -> Result<bool>
fn handle_set_gamepad_light( &self, device_id: String, r_value: i8, g_value: i8, b_value: i8, ) -> Result<bool>
Change the light of gamepad (for ruyi controller only)
Sourcefn handle_set_ruyi_controller_status(
&self,
channel: i8,
enable_r: bool,
enable_g: bool,
enable_b: bool,
enable_motor1: bool,
enable_motor2: bool,
shutdown: bool,
r_value: i8,
g_value: i8,
b_value: i8,
motor1_value: i8,
motor1_time: i8,
motor2_value: i8,
motor2_time: i8,
) -> Result<bool>
fn handle_set_ruyi_controller_status( &self, channel: i8, enable_r: bool, enable_g: bool, enable_b: bool, enable_motor1: bool, enable_motor2: bool, shutdown: bool, r_value: i8, g_value: i8, b_value: i8, motor1_value: i8, motor1_time: i8, motor2_value: i8, motor2_time: i8, ) -> Result<bool>
Obsolete. Temporary api the change the ruyi controller’s state, will be removed later.