mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-15 10:46:41 -04:00
Draft: screenreader: Add TriggerAction functionality.
Add functionality for various actions by sending left control key press and release events. Also add to steamosctl trigger_action support. NOTE: Stop Speaking action should be changed to use orca's new dbus api once that's packaged.
This commit is contained in:
parent
631f30bc94
commit
42e89ef342
6 changed files with 164 additions and 4 deletions
|
@ -31,7 +31,7 @@ use crate::power::{
|
|||
get_gpu_clocks, get_gpu_clocks_range, get_gpu_performance_level, get_gpu_power_profile,
|
||||
get_max_charge_level, get_platform_profile, TdpManagerCommand,
|
||||
};
|
||||
use crate::screenreader::{OrcaManager, ScreenReaderMode};
|
||||
use crate::screenreader::{OrcaManager, ScreenReaderAction, ScreenReaderMode};
|
||||
use crate::wifi::{
|
||||
get_wifi_backend, get_wifi_power_management_state, list_wifi_interfaces, WifiBackend,
|
||||
};
|
||||
|
@ -707,6 +707,17 @@ impl ScreenReader0 {
|
|||
.map_err(to_zbus_fdo_error)?;
|
||||
self.mode_changed(&ctx).await.map_err(to_zbus_fdo_error)
|
||||
}
|
||||
|
||||
async fn trigger_action(&mut self, a: u32, timestamp: u64) -> fdo::Result<()> {
|
||||
let action = match ScreenReaderAction::try_from(a) {
|
||||
Ok(action) => action,
|
||||
Err(err) => return Err(fdo::Error::InvalidArgs(err.to_string())),
|
||||
};
|
||||
self.screen_reader
|
||||
.trigger_action(action, timestamp)
|
||||
.await
|
||||
.map_err(to_zbus_fdo_error)
|
||||
}
|
||||
}
|
||||
|
||||
#[interface(name = "com.steampowered.SteamOSManager1.Storage1")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue