From 32d329e64cf9fb763413edf1b4b97dcd1b2b73fb Mon Sep 17 00:00:00 2001 From: Metalblueberry Date: Sat, 12 Dec 2020 18:12:06 +0100 Subject: [PATCH] add sleep and a warning for key release --- cmd/chkb/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/chkb/main.go b/cmd/chkb/main.go index b1caf6d..70c90dc 100644 --- a/cmd/chkb/main.go +++ b/cmd/chkb/main.go @@ -36,6 +36,11 @@ func main() { Debug("Set debug level") } + // This is required to ensure that the enter key is not stuck down + // when the device is grab. + log.Info("You have 200 ms to release all keys") + time.Sleep(200 * time.Millisecond) + devs := make([]*evdev.InputDevice, 0) for _, arg := range flag.Args() { dev, err := evdev.Open(arg) @@ -144,6 +149,7 @@ func capture(dev *evdev.InputDevice, evs chan []chkb.InputEvent) { if err != nil { continue } + log.WithField("event", ev).Debug("Captured") inputEvents = append(inputEvents, ev) } evs <- inputEvents