func (d *Deck) triggerAction(index uint8, hold bool) {
	for _, w := range d.Widgets {
		if w.Key() == index {
			var a *ActionConfig
			if hold {
				a = w.ActionHold()
			} else {
				a = w.Action()
			}

			if a != nil {
				fmt.Println("Executing overloaded action")
				if a.Deck != "" {
					d, err := LoadDeck(a.Deck)
					if err != nil {
						log.Fatal(err)
					}
					err = dev.Clear()
					if err != nil {
						log.Fatal(err)
					}

					deck = d
					deck.updateWidgets()
				}
				if a.Keycode != "" {
					emulateKeyPress(a.Keycode)
				}
				if a.Paste != "" {
					emulateClipboard(a.Paste)
				}
				if a.DBus.Method != "" {
					executeDBusMethod(a.DBus.Object, a.DBus.Path, a.DBus.Method, a.DBus.Value)
				}
				if a.Exec != "" {
					go executeCommand(a.Exec)
				}
			} else {
				w.TriggerAction()
			}
		}
	}
}
// triggerAction triggers an action.
triggerAction triggers an action.
// triggerAction triggers an action .
func (d *Deck) triggerAction(index uint8, hold bool) {
	for _, w := range d.Widgets {
		if w.Key() == index {
			var a *ActionConfig
			if hold {
				a = w.ActionHold()
			} else {
				a = w.Action()
			}
			if a != nil {
				fmt.Println("Executing overloaded action")
				if a.Deck != "" {
					d, err := LoadDeck(a.Deck)
					if err != nil {
						log.Fatal(err)
					}
					err = dev.Clear()
					if err != nil {
						log.Fatal(err)
					}
					deck = d
					deck.updateWidgets()
				}
				if a.Keycode != "" {
					emulateKeyPress(a.Keycode)
				}
				if a.Paste != "" {
					emulateClipboard(a.Paste)
				}
				if a.DBus.Method != "" {
					executeDBusMethod(a.DBus.Object, a.DBus.Path, a.DBus.Method, a.DBus.Value)
				}
				if a.Exec != "" {
					go executeCommand(a.Exec)
				}
			} else {
				w.TriggerAction()
			}
		}
	}
}
func ( d * Deck ) triggerAction ( index uint8 , hold bool ) { for _ , w := range d . Widgets { if w . Key ( ) == index { var a * ActionConfig if hold { a = w . ActionHold ( ) } else { a = w . Action ( ) } if a != nil { fmt . Println ( " " ) if a . Deck != " " { d , err := LoadDeck ( a . Deck ) if err != nil { log . Fatal ( err ) } err = dev . Clear ( ) if err != nil { log . Fatal ( err ) } deck = d deck . updateWidgets ( ) } if a . Keycode != " " { emulateKeyPress ( a . Keycode ) } if a . Paste != " " { emulateClipboard ( a . Paste ) } if a . DBus . Method != " " { executeDBusMethod ( a . DBus . Object , a . DBus . Path , a . DBus . Method , a . DBus . Value ) } if a . Exec != " " { go executeCommand ( a . Exec ) } } else { w . TriggerAction ( ) } } } }
triggerAction triggers an action.
triggerAction triggers an action .