Fix keypad emu

main
Minizbot2012 4 years ago
parent 3d01497656
commit aaeded4c2a
No known key found for this signature in database
GPG Key ID: 977C8ADE12361917

@ -0,0 +1,25 @@
package keypad
import (
"github.com/bendahl/uinput"
"github.com/minizbot2012/orbmap/interface/keyevents"
)
var vkm uinput.Keyboard
func init() {
vkm, _ = uinput.CreateKeyboard("/dev/uinput", []byte("Orbmap"))
}
func procKey(kb chan *keyevents.KeyEvent) {
for {
KeyEv := <-kb
if KeyEv.Type == 1 {
if KeyEv.Value == 1 {
vkm.KeyDown(KeyEv.Code)
} else if KeyEv.Value == 2 {
} else {
vkm.KeyUp(KeyEv.Code)
}
}
}
}

@ -16,7 +16,7 @@ func main() {
Maps := orbweaver.ProcOrbFiles(orbs, path)
KeyBus := make(chan *keyevents.KeyEvent, 128)
for i := 0; i <= 4; i++ {
go procKey(KeyBus)
go keypad.procKey(KeyBus)
}
orbweaver.OrbLoop(Maps, KeyBus)
}

Loading…
Cancel
Save