mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-03-15 07:26:44 +08:00
feat(hid): 添加 Consumer Control 多媒体按键和多平台键盘布局
- 新增 Consumer Control HID 支持(播放/暂停、音量控制等) - 虚拟键盘支持 Windows/Mac/Android 三种布局切换 - 移除键盘 LED 反馈以节省 USB 端点(从 2 减至 1) - InfoBar 优化:按键名称友好显示,移除未实现的 Num/Scroll 指示器 - 更新 HID 模块文档
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use async_trait::async_trait;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::types::{KeyboardEvent, MouseEvent};
|
||||
use super::types::{ConsumerEvent, KeyboardEvent, MouseEvent};
|
||||
use crate::error::Result;
|
||||
|
||||
/// Default CH9329 baud rate
|
||||
@@ -94,6 +94,14 @@ pub trait HidBackend: Send + Sync {
|
||||
/// Send a mouse event
|
||||
async fn send_mouse(&self, event: MouseEvent) -> Result<()>;
|
||||
|
||||
/// Send a consumer control event (multimedia keys)
|
||||
/// Default implementation returns an error (not supported)
|
||||
async fn send_consumer(&self, _event: ConsumerEvent) -> Result<()> {
|
||||
Err(crate::error::AppError::BadRequest(
|
||||
"Consumer control not supported by this backend".to_string(),
|
||||
))
|
||||
}
|
||||
|
||||
/// Reset all inputs (release all keys/buttons)
|
||||
async fn reset(&self) -> Result<()>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user