As far as commanline goes, GLib will readkeys too. See Readkey with timer using Glib. So you can get the keycodes with Glib in a commandlinr app, the only thing you need to do is find out where in the Gtk2 headers, they translate the keycodes to keyboard names like F2, etc. It's probably in a header file somewhere. In any event, it's alot easier to use an event-loop system, like Glib, Curses, POE, etc., than to use a while(1) loop.
| [reply] |