Skip to content

Commit

Permalink
fix(examples): fix logging in snoop example
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed May 1, 2023
1 parent 884731f commit f7e8f16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/snoop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func main() {
keys := gokbd.SnoopAllKeyboards(gokbd.OpenKeyboardDevices())
for k := range keys {
if k.Value == 1 && k.TypeName == "EV_KEY" {
log.Debug().Msgf("Key pressed: %s %s %d %c\n", k.TypeName, k.EventName, k.Value, k.AsRune)
log.Debug().Msgf("Key pressed: %s %s %d %c", k.TypeName, k.EventName, k.Value, k.AsRune)
}
if k.Value == 0 && k.TypeName == "EV_KEY" {
log.Debug().Msgf("Key released: %s %s %d\n", k.TypeName, k.EventName, k.Value)
log.Debug().Msgf("Key released: %s %s %d", k.TypeName, k.EventName, k.Value)
}
if k.Value == 2 && k.TypeName == "EV_KEY" {
log.Debug().Msgf("Key held: %s %s %d %c\n", k.TypeName, k.EventName, k.Value, k.AsRune)
log.Debug().Msgf("Key held: %s %s %d %c", k.TypeName, k.EventName, k.Value, k.AsRune)
}
}
}

0 comments on commit f7e8f16

Please sign in to comment.