Skip to content

Commit

Permalink
Check for keyboard emulation being available before triggering an action
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Jul 19, 2019
1 parent 19b078a commit 6fd535a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deck.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ func LoadDeck(deck string) (*Deck, error) {

// emulates a (multi-)key press
func emulateKeyPress(keys string) {
if keyboard == nil {
log.Println("Keyboard emulation is disabled!")
return
}

kk := strings.Split(keys, "-")
for i, k := range kk {
kc, err := strconv.Atoi(k)
Expand Down

0 comments on commit 6fd535a

Please sign in to comment.