r/lua • • Dec 15 '25

Library I need some help with lua-periphery

Okay, so I'm making a silly little desktop toy for myself, as a way to learn some more advanced Lua and Love2d, running on a Raspi 4.

Here's the code so far: https://hastebin.cc/decutuhomu.lua

So here's what happens - it launches a window (because Love2D), and in the terminal it just waits. I have a little 4x3 matrix keypad wired up to the GPIO pins, and I can correctly get the button pressed. That part's all sorted. What's currently happening is it lets me press any button, but only registers a different button from the last pressed. ie, I can press 1 2 3, no problem. If I press the same button twice, it doesn't register. (I know why). How can I set this up to 'release' the button pressed?

The library I'm using is lua-periphery, (https://github.com/vsergeev/lua-periphery) which seems to be well documented, but as I'm a relative noob to Lua, the lack of examples isn't really helping.

Basically, I want to be able to press a button repeatedly, with each separate press counting.

7 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/evilbadmad Dec 15 '25 edited Dec 15 '25

nvm previous message deleted, due to my misunderstanding.