Skip to content

Commit 6fd535a

Browse files
committed
Check for keyboard emulation being available before triggering an action
1 parent 19b078a commit 6fd535a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎deck.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func LoadDeck(deck string) (*Deck, error) {
3131

3232
// emulates a (multi-)key press
3333
func emulateKeyPress(keys string) {
34+
if keyboard == nil {
35+
log.Println("Keyboard emulation is disabled!")
36+
return
37+
}
38+
3439
kk := strings.Split(keys, "-")
3540
for i, k := range kk {
3641
kc, err := strconv.Atoi(k)

0 commit comments

Comments
 (0)
⌂ 换网址