LUA Projects > Code Sharing - "Snipits"

LUA First question: Keyboard events....


This is more abstract and deals with functionality.

I downloaded the SimInnovation gauge suite and it's all based on LUA programming.

Does LUA have a library/facility to work with keyboard events? I see facilities for Joystick events which has me thinking. With regard to rotary encoders, they need to be spun with some vigor sometimes. My concern is that if the rotaries use joystick events, that the overall joystick architecture will end up missing a lot of those button events, while my experience has shown that working with keyboard events is a lot cleaner.

Can anyone share their experiences?

Trevor Hale:

Lua itself does not natively accept inputs. But like arduino there are library's you can import.

Take a look at the io library, which by default has standard-input as the default input file:

--- Quote ---local answer
   io.write("continue with this operation (y/n)? ")
until answer=="y" or answer=="n"

--- End quote ---



[0] Message Index

Go to full version