Skip to content

Commit

Permalink
cap1xxx.go: shift input statuses by d.inputStatuses array len (google…
Browse files Browse the repository at this point in the history
…#449)

Co-authored-by: sante at os76.xyz <sante@os76.xyz>
  • Loading branch information
xenOs76 and sante at os76.xyz committed Nov 1, 2020
1 parent e686076 commit 211a340
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion devices/cap1xxx/cap1xxx.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ func (d *Dev) InputStatus(t []TouchStatus) error {
// deltas[i] > int(thresholds[i])

// If the bit is set, it was touched.
if status&(1<<(7-i)) != 0 {
idx := len(d.inputStatuses) - 1
if status&(1<<(uint8(idx)-i)) != 0 {
if d.inputStatuses[i] == PressedStatus {
if d.opts.RetriggerOnHold {
d.inputStatuses[i] = HeldStatus
Expand Down

0 comments on commit 211a340

Please sign in to comment.