Key process threading

main
Minizbot2012 4 years ago
parent d466f3dde2
commit 2433e77c2d
No known key found for this signature in database
GPG Key ID: 977C8ADE12361917

@ -15,6 +15,8 @@ func main() {
path, _ := os.Getwd()
Maps := orbweaver.ProcOrbFiles(orbs, path)
KeyBus := make(chan keyevents.KeyEvent, 128)
go procKey(KeyBus)
for i := 0; i <= 4; i++ {
go procKey(KeyBus)
}
orbweaver.OrbLoop(Maps, KeyBus)
}

@ -5,9 +5,12 @@ import (
"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) {
vkm, _ := uinput.CreateKeyboard("/dev/uinput", []byte("Orbmap"))
defer vkm.Close()
for {
KeyEv := <-kb
if KeyEv.Type == 1 {

Loading…
Cancel
Save