feat: 新增 Linux 绝对鼠标兼容模式 #266;新增 CH9329 描述符设置

This commit is contained in:
mofeng-git
2026-06-14 20:59:23 +08:00
parent da61644dbc
commit 5c98aea7e3
21 changed files with 1403 additions and 105 deletions

View File

@@ -39,13 +39,19 @@ impl HidBackendFactory {
async fn create(&self, backend_type: &HidBackendType) -> Result<Option<Arc<dyn HidBackend>>> {
match backend_type {
HidBackendType::Otg => self.create_otg_backend().await.map(Some),
HidBackendType::Ch9329 { port, baud_rate } => {
HidBackendType::Ch9329 {
port,
baud_rate,
hybrid_mouse,
} => {
info!(
"Initializing CH9329 HID backend on {} @ {} baud",
port, baud_rate
"Initializing CH9329 HID backend on {} @ {} baud, hybrid_mouse={}",
port, baud_rate, hybrid_mouse
);
Ok(Some(Arc::new(ch9329::Ch9329Backend::with_baud_rate(
port, *baud_rate,
Ok(Some(Arc::new(ch9329::Ch9329Backend::with_options(
port,
*baud_rate,
*hybrid_mouse,
)?)))
}
HidBackendType::None => {