[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Module to listen for arrow keys and alt keys?
- From: Steve Litt <slitt@...>
- Date: Mon, 2 Apr 2012 14:30:59 -0400
I wrote a picklist program and a filepicker in C. See this for why I
Yes, it's deliberately written *without* ncurses. Ideally I'd like to
keep ncurses out of it -- ncurses has some memory leaks that aren't
cumulative or important but mess up valgrind, plus ncurses key
detection isn't much better than C's standard libraries.
My C versions have some bugs and lack some features. Writing them in C
was difficult. I'm going to try rewriting them in Lua. Now this may be
an exercise in futility because Lua might not be fast enough to
continuously scroll a list of items. But maybe it will be, especially
if I use LuaJIT.
Anyway, as long as I'm rewriting it in Lua, I might as well use any
keystroke detection available with Lua. Specifically, I need a module
that reliably detects cursor keys and can tell the difference between
Ctrl+F5 and Ctrl+Alt+F5, and in general sanely handle keypresses that
generate multiple codes. Anyone know of such a thing already existing
in Lua, or available for Lua?