add input.Buffered and input.Keyboard and a binary to try combo
This commit is contained in:
24
src/device/input/.keyboard_integration.d/main.go
Normal file
24
src/device/input/.keyboard_integration.d/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"mayhem-party/src/device/input"
|
||||
)
|
||||
|
||||
func main() {
|
||||
k := input.NewBuffered(input.NewKeyboard())
|
||||
defer func() {
|
||||
recover()
|
||||
k.Close()
|
||||
}()
|
||||
|
||||
log.Printf("try the keyboard")
|
||||
n := 5
|
||||
for n > 0 {
|
||||
result := k.Read()
|
||||
n -= len(result)
|
||||
for j := range result {
|
||||
log.Printf("[%d][%d] %c|%v", n, j, result[j].Char, result[j].Down)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user