This is a simple package for communicating with the Linux input filesystem.
- List input devices
- Filter input devices by event
- Build in filters for keyboards, pointers and touch-pads
- Check if a device supports a particular event
- Check if a device supports a particular key-code
- Read events from input devices
go get github.com/nathan-fiscaletti/dev-input
package main
import "github.com/nathan-fiscaletti/dev-input"
func main() {
keyboards, err := input.ListKeyboards()
if err != nil {
panic(err)
}
for _, keyboard := range keyboards {
fmt.Printf("Keyboard: %s\n", keyboard.Name)
}
}
See the Go Docs for more detailed usage.