Struct roccat_vulcan_api_rs::KeyboardApi [−][src]
pub struct KeyboardApi { /* fields omitted */ }
Expand description
Main API
Implementations
Look for the default configuration
Errors
ErrorRoccatVulcanApi::KeyboardNotFound
Keyboard not found,ErrorRoccatVulcanApi::NoLedDevice
Led device not found,ErrorRoccatVulcanApi::LedDeviceError
Led device error,ErrorRoccatVulcanApi::NoControlDevice
Control device not found,ErrorRoccatVulcanApi::ControlDeviceError
Control device error,ErrorRoccatVulcanApi::NoReadDevice
Read device not found,ErrorRoccatVulcanApi::ReadDeviceError
Read device error,ErrorRoccatVulcanApi::WaitedToMuchTime
Error while initalizing key board: waited for too long,ErrorRoccatVulcanApi::HidApiError
Api 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::InvalidInput
the duration is not valide (too big)ErrorRoccatVulcanApi::ReadDeviceError
if 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