This Lua library is a wrapper around the ncurses C API meant to let you use the ncurses library in Lua.
Not all the functions are ported, the list of currentely ported function is the following:
- initscr
- endwin
- curs_set
- printw
- mvprintw
- move
- getmaxyx
- getch
- echo
- noecho
- has_colors
- start_color
- use_default_colors
- init_pair
- nodelay
- refresh
- set_color
Some other symbols needed to use ncurses are available, they are the following:
- KEY_ENTER
- KEY_BACKSPACE
- KEY_UP
- KEY_DOWN
- KEY_LEFT
- KEY_RIGHT
- KEY_HOME
- KEY_END
- KEY_NPAGE
- KEY_PPAGE
To install the library, simply do make && sudo make install from the root of the repository.
This library is meant to be required, like any other Lua libraries. To do so, start your program with local nc = require("cursedLua"). All the functions are inside the table nc. For example, to print something, you must do nc.printw("something"). For a more detailed example, check out the example folder.
When using embedded Lua, don't forget to link the library to your binary with -lcursedLua.
For every function, the number of arguments or their types is the same as the one expected by the ncurses C API.
To see this library in actual use, you can check out the programs I made with it.