Skip to content

Commit

Permalink
separate devices
Browse files Browse the repository at this point in the history
  • Loading branch information
positiveway committed Jun 7, 2024
1 parent c86298c commit 1858bf0
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/virtual_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,23 @@ const UINPUT_NOT_LOADED_ERR: &str = "'uinput' module probably is not loaded. try

impl VirtualDevice {
pub fn default() -> Result<Self> {
VirtualDevice::new(
Self::default_single_device(DeviceDefinitionType::None)
}

fn default_single_device(definition_type: DeviceDefinitionType) -> Result<Self>{
Self::new(
Duration::from_millis(1),
50,
DeviceDefinitionType::None,
definition_type,
)
}
// pub fn new(writing_interval: Duration, channel_size: usize, separate_devices: bool) -> Result<(Self, Self)> {
// Ok((
// Self::_new(writing_interval, channel_size, true)?,
// Self::_new(writing_interval, channel_size, false)?,
// ))
// }

pub fn default_separate() -> Result<(Self, Self)> {
Ok((
Self::default_single_device(DeviceDefinitionType::MouseOnly)?,
Self::default_single_device(DeviceDefinitionType::KeyboardOnly)?,
))
}

fn new(writing_interval: Duration, channel_size: usize, definition_type: DeviceDefinitionType) -> Result<Self> {
let (s, r) = bounded(channel_size);
Expand Down

0 comments on commit 1858bf0

Please sign in to comment.