Skip to content

Commit

Permalink
Bump dependency and use newly added keys attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
zMoooooritz authored and muesli committed Jul 5, 2021
1 parent d21c644 commit 14d2207
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deck.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func LoadDeck(dev *streamdeck.Device, base string, deck string) (*Deck, error) {
keyMap[k.Index] = k
}

for i := uint8(0); i < dev.Columns*dev.Rows; i++ {
for i := uint8(0); i < dev.Keys; i++ {
bg := d.backgroundForKey(dev, i)

var w Widget
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ require (
github.com/jezek/xgbutil v0.0.0-20210302171758-530099784e66
github.com/lucasb-eyer/go-colorful v1.2.0
github.com/mitchellh/go-homedir v1.1.0
github.com/muesli/streamdeck v0.2.1-0.20210621143110-f4204010563d
github.com/muesli/streamdeck v0.2.2-0.20210705154802-91a7f4efcdfd
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/shirou/gopsutil v2.18.12+incompatible
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/muesli/streamdeck v0.2.1-0.20210621143110-f4204010563d h1:IbVerrjKYLmwMqLBHpvtLN1noZk6IELc7Xbpwm4sE2Q=
github.com/muesli/streamdeck v0.2.1-0.20210621143110-f4204010563d/go.mod h1:VnSRlfQP7FH1GRcVJY/kV6MofesFPVPaSOJLa08JeqE=
github.com/muesli/streamdeck v0.2.2-0.20210705154802-91a7f4efcdfd h1:ypju39Hk5AngDLVH9CPf5iWgmIkmaNtOmUeFUCqfW2o=
github.com/muesli/streamdeck v0.2.2-0.20210705154802-91a7f4efcdfd/go.mod h1:VnSRlfQP7FH1GRcVJY/kV6MofesFPVPaSOJLa08JeqE=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
Expand Down Expand Up @@ -129,6 +131,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e h1:PzJMNfFQx+QO9hrC1GwZ4BoPGeNGhfeQEgcQFArEjPk=
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand All @@ -148,8 +152,10 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func initDevice() (*streamdeck.Device, error) {
if !found {
fmt.Println("Can't find device. Available devices:")
for _, v := range d {
fmt.Printf("Serial %s (%d buttons)\n", v.Serial, v.Columns*v.Rows)
fmt.Printf("Serial %s (%d buttons)\n", v.Serial, dev.Keys)
}
os.Exit(1)
}
Expand All @@ -157,7 +157,7 @@ func initDevice() (*streamdeck.Device, error) {
return nil, err
}
fmt.Printf("Found device with serial %s (%d buttons, firmware %s)\n",
dev.Serial, dev.Columns*dev.Rows, ver)
dev.Serial, dev.Keys, ver)

if err := dev.Reset(); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion window.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func handleActiveWindowChanged(dev *streamdeck.Device, event ActiveWindowChanged
}
recentWindows = recentWindows[:i]

keys := int(dev.Rows * dev.Columns)
keys := int(dev.Keys)
recentWindows = append([]Window{event.Window}, recentWindows...)
if len(recentWindows) > keys {
recentWindows = recentWindows[0:keys]
Expand Down

0 comments on commit 14d2207

Please sign in to comment.