How do I do an event on the moon?

Asked

Viewed 74 times

2

i want to know how to make an event, for example with the do to see if the user typed 'q' or 'o', as if it were in a addEventListener()

1 answer

-1

Lua is a very simple language, by default it has no libraries to handle events much less user interfaces. Maybe you are using Lua in a specific context, if any, the libraries available to you to use should be documented by the tool itself.

For example: the package Ithui presents bindings in Lua to use ncurses (library for creating user interfaces in the terminal). In this case the event loop is fully managed by ncurses and we only use it within our Lua application.

As quoted by @Woss, the question asked in English has more in-depth responses.

I know the question is old, but I think it’s important for people like me who are learning to program on Lua to have a more direct and simple answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.