Struct roccat_vulcan_api_rs::KeyboardApi [−][src]
pub struct KeyboardApi { /* fields omitted */ }Expand description
Main API
Implementations
Look for the default configuration
Errors
ErrorRoccatVulcanApi::KeyboardNotFoundKeyboard not found,ErrorRoccatVulcanApi::NoLedDeviceLed device not found,ErrorRoccatVulcanApi::LedDeviceErrorLed device error,ErrorRoccatVulcanApi::NoControlDeviceControl device not found,ErrorRoccatVulcanApi::ControlDeviceErrorControl device error,ErrorRoccatVulcanApi::NoReadDeviceRead device not found,ErrorRoccatVulcanApi::ReadDeviceErrorRead device error,ErrorRoccatVulcanApi::WaitedToMuchTimeError while initalizing key board: waited for too long,ErrorRoccatVulcanApi::HidApiErrorApi error,
pub fn new_from_model_list(
api: &HidApi,
interfaces_info: &[KeyboardIntrefacesFilter]
) -> Result<Self, ErrorRoccatVulcanApi>
[src]
pub fn new_from_model_list(
api: &HidApi,
interfaces_info: &[KeyboardIntrefacesFilter]
) -> Result<Self, ErrorRoccatVulcanApi>
[src]pub fn new_model(
api: &HidApi,
interface: &KeyboardIntrefacesFilter
) -> Result<Self, ErrorRoccatVulcanApi>
[src]
pub fn new_model(
api: &HidApi,
interface: &KeyboardIntrefacesFilter
) -> Result<Self, ErrorRoccatVulcanApi>
[src]pub fn render(
&self,
buffer: &ColorBuffer<impl Into<ColorRgb> + Copy>
) -> Result<(), ErrorRoccatVulcanApi>
[src]
pub fn render(
&self,
buffer: &ColorBuffer<impl Into<ColorRgb> + Copy>
) -> Result<(), ErrorRoccatVulcanApi>
[src]Renders a collor buffer
Errors
ErrorRoccatVulcanApi::LedDeviceError if the lead device encountered an error
pub fn read_key_press(
&self,
duration: Duration
) -> Result<Vec<KeyPress>, ErrorRoccatVulcanApi>
[src]
pub fn read_key_press(
&self,
duration: Duration
) -> Result<Vec<KeyPress>, ErrorRoccatVulcanApi>
[src]read key press for a time of at least duration and return a vector of the keypress that occured for this duration.
Errors
ErrorRoccatVulcanApi::InvalidInputthe duration is not valide (too big)ErrorRoccatVulcanApi::ReadDeviceErrorif the read device had an error
Example
use std::time::Duration; use roccat_vulcan_api_rs::{ErrorRoccatVulcanApi, KeyboardApi}; let keyboard = KeyboardApi::new()?; let result = keyboard.read_key_press(Duration::from_millis(400))?; println!("{:?}", result);
Block the thread until a key event or an error occur
Errors
ErrorRoccatVulcanApi::ReadDeviceError when the read device has an error