key.To/FromChar
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"mayhem-party/src/device/input"
|
||||
"mayhem-party/src/device/output"
|
||||
"mayhem-party/src/device/output/key"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -22,13 +23,13 @@ func Main(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
state := map[output.Key]bool{}
|
||||
state := map[key.Key]bool{}
|
||||
for block() {
|
||||
delta := reader.Read()
|
||||
for _, button := range delta {
|
||||
state[output.Key(button.Char)] = button.Down
|
||||
state[key.FromChar(button.Char)] = button.Down
|
||||
}
|
||||
keys := make([]output.Key, 0)
|
||||
keys := make([]key.Key, 0)
|
||||
for k, v := range state {
|
||||
if v {
|
||||
keys = append(keys, k)
|
||||
|
||||
Reference in New Issue
Block a user