debugs
parent
e832085fc2
commit
37d02f0f52
|
|
@ -2,6 +2,7 @@ package input
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
@ -60,5 +61,8 @@ func (kb Keyboard) Read() []Button {
|
||||||
down = true
|
down = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if os.Getenv("DEBUG") == "true" {
|
||||||
|
log.Printf("input.Keyboard.Read() %s => %+v", b[:n], result)
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package src
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"log"
|
||||||
"mayhem-party/src/device/input"
|
"mayhem-party/src/device/input"
|
||||||
"mayhem-party/src/device/output"
|
"mayhem-party/src/device/output"
|
||||||
"mayhem-party/src/device/output/key"
|
"mayhem-party/src/device/output/key"
|
||||||
|
|
@ -37,6 +38,9 @@ func Main(ctx context.Context) error {
|
||||||
state := map[key.Key]bool{}
|
state := map[key.Key]bool{}
|
||||||
for block() {
|
for block() {
|
||||||
delta := reader.Read()
|
delta := reader.Read()
|
||||||
|
if os.Getenv("DEBUG") == "true" {
|
||||||
|
log.Printf("src.Main.reader.Read(): %+v", delta)
|
||||||
|
}
|
||||||
for _, button := range delta {
|
for _, button := range delta {
|
||||||
state[key.FromChar(button.Char)] = button.Down
|
state[key.FromChar(button.Char)] = button.Down
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue