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
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//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"
|
||||
}
|
||||
Reference in New Issue
Block a user