Re: GUI-less app to capture key_press_events only



* Eric Lenio <eric lenio net> [2004-10-05 17:25]:
Actually the issue is related to the Curses.pm module: the
problem is that Curses does NOT trigger an event by pressing
the control (or shift or mod) key by itself.  I fumbled my way
through building a very simple Gtk2 app which did recognize the
event.  But that little test app had a Gtk window, and I want
to get away from having any window.

Hmm.. Google Groups finds

Message-Id: <iznog77lx3h fsf stekt46 oulu fi>

You need to set the console in a mode in which it gives you key
codes and not ASCII characters.  The ioctl is in <linux/kd.h>, IIRC.

There is also a program called "dumpkey" or "showkey" which
waits for key presses and displays the key codes.  Its source
code might help you.  The program was part of the "kbd"
package, I think.

and

Message-ID: <LdhL4 780$f77 14961 news6-win server ntlworld com>

IMHO, a better route might be to use one of the libraries for
raw mode which already exist. :-) If you're using svgalib, `man
keyboard_init' is a good place to start. In the unlikely event
that you're needing to read such keys in text mode, you might
want to try my old `rawkey' library, which I think is at
ftp://metalab.unc.edu/pub/Linux/libs/ui/rawkey-0.21.tar.gz.
Most likely you'll want to use svgalib though.

Regards,
-- 
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]