@@ -11,12 +11,12 @@ import (
1111 "github.com/godbus/dbus"
1212)
1313
14- // Deck is a set of widgets
14+ // Deck is a set of widgets.
1515type Deck struct {
1616 Widgets []Widget
1717}
1818
19- // LoadDeck loads a deck configuration
19+ // LoadDeck loads a deck configuration.
2020func LoadDeck (deck string ) (* Deck , error ) {
2121 d := Deck {}
2222 dc , err := LoadConfig (deck )
@@ -32,7 +32,7 @@ func LoadDeck(deck string) (*Deck, error) {
3232 return & d , nil
3333}
3434
35- // emulates a (multi-)key press
35+ // emulates a (multi-)key press.
3636func emulateKeyPress (keys string ) {
3737 if keyboard == nil {
3838 log .Println ("Keyboard emulation is disabled!" )
@@ -55,7 +55,7 @@ func emulateKeyPress(keys string) {
5555 }
5656}
5757
58- // emulates a clipboard paste
58+ // emulates a clipboard paste.
5959func emulateClipboard (text string ) {
6060 err := clipboard .WriteAll (text )
6161 if err != nil {
@@ -66,15 +66,15 @@ func emulateClipboard(text string) {
6666 emulateKeyPress ("29-47" ) // ctrl-v
6767}
6868
69- // executes a dbus method
69+ // executes a dbus method.
7070func executeDBusMethod (object , path , method , args string ) {
7171 call := dbusConn .Object (object , dbus .ObjectPath (path )).Call (method , 0 , args )
7272 if call .Err != nil {
7373 log .Printf ("dbus call failed: %s" , call .Err )
7474 }
7575}
7676
77- // executes a command
77+ // executes a command.
7878func executeCommand (cmd string ) {
7979 args := strings .Split (cmd , " " )
8080 c := exec .Command (args [0 ], args [1 :]... )
@@ -87,7 +87,7 @@ func executeCommand(cmd string) {
8787 }
8888}
8989
90- // triggerAction triggers an action
90+ // triggerAction triggers an action.
9191func (d * Deck ) triggerAction (index uint8 , hold bool ) {
9292 for _ , w := range d .Widgets {
9393 if w .Key () == index {
@@ -132,7 +132,7 @@ func (d *Deck) triggerAction(index uint8, hold bool) {
132132 }
133133}
134134
135- // updateWidgets updates/repaints all the widgets
135+ // updateWidgets updates/repaints all the widgets.
136136func (d * Deck ) updateWidgets () {
137137 for _ , w := range d .Widgets {
138138 w .Update (& dev )
0 commit comments