linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vidya Kotamraju <vidyakr@darya.nio.org>
To: linux-c-programming@vger.kernel.org
Subject: Re: Control key with Ncurses
Date: Fri, 04 Jul 2003 16:14:25 +0530	[thread overview]
Message-ID: <3F055A89.4000401@darya.nio.org> (raw)
In-Reply-To: 16131.55520.62578.551805@cerise.nosuchdomain.co.uk

I had enabled the keypad() along with the other graphics initializations.
Also, Control codes do work with getch().
But what i need to know is how to make use of a control key to exit out 
of a scanw input. (As control-D would work with scanf without needing to 
make use of getchar)


Regards,
Vidya.

Glynn Clements wrote:

 > Vidya Kotamraju wrote:
 >
 >
 >>I am writing a graphics-based application in Linux by making use of C
 >>and ncurses library.
 >>The application needs that i take two numbers as input ( i make use of
 >>scanw for the same).
 >>However at this point in the program i want the user to obtain the
 >>flexibility of exiting gracefully from the program(by pressing a cntrl
 >>key,like say F5).
 >>
 >
 > You need to call keypad() to enable the use of "extended" keys
 > (funcion keys, arrow keys etc). The various KEY_* macros define the
 > codes for the extended keys; for function keys, use KEY_F(), e.g.
 > KEY_F(5) for F5.
 >
 >
 >>Cntrl-D doesnt seem to work with ncurses..
 >>
 >
 > Control codes should be reported by getch() etc as a code in the range
 > 0 to 31 (e.g. Ctrl-D should be code 4).
 >
 >


-- 
--------------------------------------------------------------------------
As far as the laws of mathematics refer to reality,they are not certain;
and as far as they are certain, they do not refer to reality.
                                        - Albert Einstein (1879-1955)
--------------------------------------------------------------------------
Kotamraju Vidya
Marine HydroDynamics Lab,
Physical Oceanography Division,
National Institute of Oceanography,
Dona Paula, Goa 403 004, India.
Ph.: +91-832-2456700 *4400 (O)
       +91-832-2541756 (R)
e-mail: vidyakr@darya.nio.org



  reply	other threads:[~2003-07-04 10:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-03  7:00 Control key with Ncurses Vidya Kotamraju
2003-07-03  7:18 ` Glynn Clements
2003-07-04 10:44   ` Vidya Kotamraju [this message]
2003-07-04 14:47     ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F055A89.4000401@darya.nio.org \
    --to=vidyakr@darya.nio.org \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).