Curses and function keys [Was: Mac fkeys]
Curses and function keys [Was: Mac fkeys]
- Subject: Curses and function keys [Was: Mac fkeys]
- From: Steve Checkoway <email@hidden>
- Date: Sun, 29 Oct 2006 14:54:43 -0800
On Oct 29, 2006, at 4:33 AM, Greg Berchin wrote:
Steve Checkoway <email@hidden> wrote:
My code (which admittedly I haven't touched in a while) prints out ^
[OP for F1, ^[OR for F3 and ^[OS for F4. F2 prints nothing. I'm sure
there's some way to handle these but I never really cared that much
to dig too deeply into it.
[...]
I don't think it's really reasonable to assume that would happen.
There is already a KEY_BACKSPACE. I just used getch and printed out
the values returned.
Interesting. I tried the same thing; "delete" and F1-F4 never even
got
to getch(). They were intercepted by the system. Whatever the system
did in response crashed my program, at least some of the time.
Did you use keypad()? From the man page:
The keypad option enables the keypad of the user's
terminal. If enabled (bf is TRUE), the user can press a
function key (such as an arrow key) and wgetch returns a single
value representing the function key, as in KEY_LEFT. If disabled
(bf is FALSE), curses does not treat function keys specially and
the program has to interpret the escape sequences itself. If
the keypad in the terminal can be turned on (made to transmit) and
off (made to work locally), turning on this option causes the
terminal keypad to be turned on when wgetch is called. The default
value for keypad is false.
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden