[Top][All Lists]

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

Re: Finer keystroke detection

From: Dan Nelson
Subject: Re: Finer keystroke detection
Date: Tue, 11 May 2004 15:41:08 -0500
User-agent: Mutt/1.5.6i

In the last episode (May 11), Thomas Dickey said:
> > I've looked thru ncurses.h, and through man terminfo, and various
> > other docuemntation, and for the life of me I cannot find how to
> > detect things like Ctrl+Enter, Ctrl+F3, etc. These would be VERY
> > handy for an app I'm writing.
> > I even wrote a keystroke detection program to print out the value
> > of keystrokes as I type, and according to that program, Enter,
> > Shift+Enter and Ctrl+Enter are identical. According to my program,
> > the alt and Ctrl keys have no modification effect on function keys
> > etc.
> For the terminal types that do provide this sort of capability, it's
> almost always sufficient to describe those as the numbered function
> keys (terminfo lets you define 60).  Curses can recognize those.  But
> what you're describing is (for instance), Linux console which doesn't
> supply any different strings.
> (If terminals that could do this were more common, it's also possible
> to write extended terminfo entries with ncurses that have more
> meaningful names than f34, f35, etc.

If you limit yourself to console access, you could switch the keyboard
driver into raw mode, bypass ncurses completely, and process the
keyup/down sequences yourself.  There are actually some serial
terminals that do PC scancode mode, too (I have a wyse-160 that does),
but they are probably pretty rare now.  It looks like Kermit 95
supports it also (called PCTERM mode).

        Dan Nelson

reply via email to

[Prev in Thread] Current Thread [Next in Thread]