We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0163c6 commit 1f54c7dCopy full SHA for 1f54c7d
makeybutton/buffer.go
@@ -1,6 +1,6 @@
1
package makeybutton
2
3
-const bufferSize = 10
+const bufferSize = 6
4
5
// Buffer is a buffer to keep track of the most recent readings for a button.
6
type Buffer struct {
makeybutton/button.go
@@ -61,7 +61,7 @@ func (b *Button) Get() ButtonEvent {
61
b.readings.Put(pressed)
62
63
switch {
64
- case pressed && avg > 0:
+ case pressed && avg > -1 * bufferSize - 2:
65
if b.state == Press {
66
return NotChanged
67
}
0 commit comments