Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 68 additions & 23 deletions src/input/source/hidraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl HidRawDevice {
DriverType::Unknown => Err("No driver for hidraw interface found".into()),
DriverType::AyaneoHaptics => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(10),
poll_rate: Duration::from_millis(0),
buffer_size: 1024,
};
let device = AyaneoHaptics::new(device_info.clone())?;
Expand All @@ -337,7 +337,7 @@ impl HidRawDevice {
}
DriverType::Blocked => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(200),
poll_rate: Duration::from_millis(500),
buffer_size: 4096,
};
let device = BlockedHidrawDevice::new(device_info.clone())?;
Expand Down Expand Up @@ -367,7 +367,7 @@ impl HidRawDevice {
}
DriverType::SteamDeck => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(1),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = DeckController::new(device_info.clone())?;
Expand All @@ -382,7 +382,7 @@ impl HidRawDevice {
}
DriverType::LegionGo => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(8),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = LegionGoController::new(device_info.clone())?;
Expand All @@ -397,7 +397,7 @@ impl HidRawDevice {
}
DriverType::LegionGo2 => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(8),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = LegionGo2Controller::new(device_info.clone())?;
Expand All @@ -412,7 +412,7 @@ impl HidRawDevice {
}
DriverType::LegionGoSImu => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(5),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = LegionSImuController::new(device_info.clone())?;
Expand All @@ -427,7 +427,7 @@ impl HidRawDevice {
}
DriverType::LegionGoSTouchpad => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(16),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = LegionSTouchpadController::new(device_info.clone())?;
Expand All @@ -442,7 +442,7 @@ impl HidRawDevice {
}
DriverType::LegionGoSXInput => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(8),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = LegionSXInputController::new(device_info.clone())?;
Expand All @@ -457,7 +457,7 @@ impl HidRawDevice {
}
DriverType::LegionGoTouchpad => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(4),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = LegionGoTouchpad::new(device_info.clone())?;
Expand All @@ -472,7 +472,7 @@ impl HidRawDevice {
}
DriverType::MsiClaw => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(8),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = MsiClawController::new(device_info.clone())?;
Expand All @@ -487,7 +487,7 @@ impl HidRawDevice {
}
DriverType::OrangePiNeoTouchpad => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(8),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = OrangePiNeoTouchpad::new(device_info.clone())?;
Expand All @@ -507,9 +507,18 @@ impl HidRawDevice {
Ok(Self::Fts3528Touchscreen(source_device))
}
DriverType::XpadUhid => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(500),
buffer_size: 1024,
};
let device = XpadUhid::new(device_info.clone())?;
let source_device =
SourceDriver::new(composite_device, device, device_info.into(), conf);
let source_device = SourceDriver::new_with_options(
composite_device,
device,
device_info.into(),
options,
conf,
);
Ok(Self::XpadUhid(source_device))
}
DriverType::RogAlly => {
Expand All @@ -529,7 +538,7 @@ impl HidRawDevice {
}
DriverType::HoripadSteam => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(4),
poll_rate: Duration::from_millis(0),
buffer_size: 2048,
};
let device = HoripadSteam::new(device_info.clone())?;
Expand Down Expand Up @@ -560,7 +569,7 @@ impl HidRawDevice {
DriverType::ZotacZone => {
let device = ZotacZone::new(device_info.clone())?;
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(300),
poll_rate: Duration::from_millis(500),
buffer_size: 1024,
};
let source_device = SourceDriver::new_with_options(
Expand All @@ -573,28 +582,64 @@ impl HidRawDevice {
Ok(Self::ZotacZone(source_device))
}
DriverType::GpdWinMiniTouchpad => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(0),
buffer_size: 1024,
};
let device = GpdWinMiniTouchpad::new(device_info.clone())?;
let source_device =
SourceDriver::new(composite_device, device, device_info.into(), conf);
let source_device = SourceDriver::new_with_options(
composite_device,
device,
device_info.into(),
options,
conf,
);
Ok(Self::GpdWinMiniTouchpad(source_device))
}
DriverType::GpdWinMiniMacroKeyboard => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(0),
buffer_size: 1024,
};
let device = GpdWinMiniMacroKeyboard::new(device_info.clone())?;
let source_device =
SourceDriver::new(composite_device, device, device_info.into(), conf);
let source_device = SourceDriver::new_with_options(
composite_device,
device,
device_info.into(),
options,
conf,
);
Ok(Self::GpdWinMiniMacroKeyboard(source_device))
}
DriverType::OxpHid => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(0),
buffer_size: 1024,
};
let device = OxpHid::new(device_info.clone())?;
let source_device =
SourceDriver::new(composite_device, device, device_info.into(), conf);
let source_device = SourceDriver::new_with_options(
composite_device,
device,
device_info.into(),
options,
conf,
);
Ok(Self::OxpHid(source_device))
}

DriverType::Ultimate2 => {
let options = SourceDriverOptions {
poll_rate: Duration::from_millis(0),
buffer_size: 1024,
};
let device = Ultimate2::new(device_info.clone())?;
let source_device =
SourceDriver::new(composite_device, device, device_info.into(), conf);
let source_device = SourceDriver::new_with_options(
composite_device,
device,
device_info.into(),
options,
conf,
);
Ok(Self::Ultimate2(source_device))
}
}
Expand Down
Loading