ryleelyman / seamstress

seamstress is an art engine
GNU General Public License v3.0
117 stars 12 forks source link

grid sometimes fails to register press / release #11

Closed ryleelyman closed 1 year ago

ryleelyman commented 1 year ago

reported by @dndrks on Discord. minimal repro:

-- example script.lua
g = grid.connect()
last_z = 0

function g.key(x,y,z)
  if z == last_z then
    print("oops!")
  end
  last_z = z
end

expected behavior: "oops!" never prints unless you press two different keys at once, but at the moment it prints every so often if you steadily press the same key.

ryleelyman commented 1 year ago

I'm gonna reopen this. As of 0.6.3, only really mashing several keys all at once results in "oops!" in the above script or in stuck LEDs in the following

-- example script.lua
local g = grid.connect()

function g.key(x, y, z)
  if (z == 1) then
    g:led(x,y,15)
  else
    g:led(x,y,0)
  end
  print(x,y,z)
  g:refresh()
end

also when mashing the print statement occasionally includes values like 33 in x and y rather than what they should be.

I'm sort of mystified and could use expert guidance here.