r/ComputerCraft • u/LeBasou • May 17 '26
getPressedKeys not working
First off, I’m terrible at Lua, I’m more of a hack-and-slash kind of guy than someone who really knows how to code, but I manage. Could someone tell me why the `getPressedKeys` function (found on the Creators-of-Aeronautics GitHub) isn’t returning anything ? I’d like to be able to access computer functions from the Typewriter
8
Upvotes
View all comments
Show parent comment
1
u/Ictoan42 May 17 '26
First off, calling
peripheral.wrap()inside the loop is going to be very slow. You should wrap the peripheral once before the loop, and then use the sametvariable in the loop.Second, it seems that
tis nil. Try running theperipheralsprogram on the computer to list all connected peripherals, to check if the name is what you're expecting.