feat(keyboard): update keyboard layouts and key display mappings for multiple languages

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
luckfox-eng29
2026-05-08 09:59:04 +08:00
parent 7cef8baa0d
commit bf84660c8b
16 changed files with 190 additions and 43 deletions

View File

@@ -3,6 +3,7 @@ package hidrpc
import "fmt"
type Handler interface {
HandleHandshake(version byte) error
HandleKeyboardReport(modifier byte, keys []byte) error
HandleKeypressReport(key byte, press bool) error
HandleKeypressKeepAlive() error
@@ -25,6 +26,11 @@ func (s *Server) HandleMessage(data []byte) error {
}
switch msg.Type {
case MessageTypeHandshake:
if len(msg.Data) < 1 {
return fmt.Errorf("invalid handshake length: %d", len(msg.Data))
}
return s.handler.HandleHandshake(msg.Data[0])
case MessageTypeKeyboardReport:
if len(msg.Data) < 7 {
return fmt.Errorf("invalid keyboard report length: %d", len(msg.Data))