mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-07-29 14:41:45 +08:00
feat: 新增 Linux 绝对鼠标兼容模式 #266;新增 CH9329 描述符设置
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { request, ApiError } from './request'
|
||||
import type { CanonicalKey } from '@/types/generated'
|
||||
import type { CanonicalKey, Ch9329DescriptorState } from '@/types/generated'
|
||||
import { useHidWebSocket, type HidKeyboardEvent, type HidMouseEvent } from '@/composables/useHidWebSocket'
|
||||
|
||||
const API_BASE = '/api'
|
||||
@@ -435,6 +435,14 @@ export const hidApi = {
|
||||
reset: () =>
|
||||
request<{ success: boolean }>('/hid/reset', { method: 'POST' }),
|
||||
|
||||
ch9329Descriptor: (params?: { port?: string; baudRate?: number }) => {
|
||||
const query = new URLSearchParams()
|
||||
if (params?.port) query.set('port', params.port)
|
||||
if (params?.baudRate) query.set('baud_rate', String(params.baudRate))
|
||||
const suffix = query.toString()
|
||||
return request<Ch9329DescriptorState>(`/hid/ch9329/descriptor${suffix ? `?${suffix}` : ''}`)
|
||||
},
|
||||
|
||||
consumer: async (usage: number) => {
|
||||
await ensureHidConnection()
|
||||
await hidWs.sendConsumer({ usage })
|
||||
|
||||
Reference in New Issue
Block a user