Files
goSportpunktetafel/internal/usb/usb_other.go
T
hermes dfaa87994a Releases: Linux amd64 + Windows amd64 Binaries mit Build-Tags für USB
- USB-Input via evdev wird nur auf Linux gebaut (build tag linux)
- Windows bekommt USB-Stub (build tag !linux)
- Binaries: sportscore-linux-amd64 (ELF 64-bit), sportscore-windows-amd64.exe (PE32+)
- Alle Tests bestanden
2026-07-14 17:43:57 +02:00

33 lines
788 B
Go

//go:build !linux
package usb
import (
"fmt"
)
// Keyboard represents an input device (keyboard).
// Non-Linux stub.
type Keyboard struct{}
// OpenFirstKeyboard opens the first available keyboard device.
// On non-Linux platforms, it always returns an error.
func OpenFirstKeyboard() (*Keyboard, error) {
return nil, fmt.Errorf("usb keyboard input is only supported on Linux")
}
// Close releases the keyboard device.
func (kb *Keyboard) Close() error {
return nil
}
// ReadKey reads the next key event from the keyboard.
func (kb *Keyboard) ReadKey() (*Key, error) {
return nil, fmt.Errorf("usb keyboard input is only supported on Linux")
}
// GetDeviceInfo returns information about the connected keyboard.
func (kb *Keyboard) GetDeviceInfo() string {
return "linux-only"
}