comp.lang.ada
 help / color / mirror / Atom feed
* How to read keys without <CR>, also, simulated GUI?
@ 1993-04-02 14:48 rcbi110
  1993-04-04  0:41 ` Michael Clark
  0 siblings, 1 reply; 2+ messages in thread
From: rcbi110 @ 1993-04-02 14:48 UTC (permalink / raw)



How do you read the keyboard in such a way that the user doesn't need to press
return at the end of their response, but can merely hit a single key and some
action will happen?

Are there any ftp'able packages out there that draw 'simulated' gui features on
a VT200-type screen (or a PC with ANSI.SYS) for instance:
                                          ______
  Quit?                   or a 'menu'    | FILE |__
  _____   _____                          | Open... |
 | YES | | NO  |                         | Close   |
  ~~~~~   ~~~~~                          | Quit    |
 requester with 'buttons'                 ~~~~~~~~~ 


((   ||  /\\ \\  / /\\  ((      R. Alan Monroe       ((   STOP             ((
 )) _// /--\\ \\/ /--\\  )) rcbi110@muvms3.wvnet.edu  ))  TALKING...        ))
((              _       ((                           ((       START        ((
 ))  ||  /\\  //  ||_/   ))    Pinkwater Rules!       ))      CHALKING!     ))
((  _// /--\\ \\_ || \  ((            :^)            ((               -CMB ((




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to read keys without <CR>, also, simulated GUI?
  1993-04-02 14:48 How to read keys without <CR>, also, simulated GUI? rcbi110
@ 1993-04-04  0:41 ` Michael Clark
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Clark @ 1993-04-04  0:41 UTC (permalink / raw)


  There are basically two methods for achieving "raw" character entries
from the keyboard.  I can speak only from use with Janus/Ada.  If you
just want to have the user hit a key (any key, for that matter) with
no real prescribed action, simple put a SKIP_LINE directly after the GET.
A better approach would be to the implementation dependencies of I/O.
The easiest way is to open a default "raw" keyboard file using the
following syntax :

       OPEN(KEYBOARD_FILE, OUT_FILE, "KBD:");

The "KBD:" is a special device name, which basically is a buffer
for the keyboard.  The file does not need to be CREATED, only OPENed.
You can then test the contents of the file (e.g. see what character
was hit) by using GET(KEYBOARD_FILE, CHARACTER) where CHARACTER has
been defined to an appropriate type.
   I have used this method several time, and if you need more infor
or sample source code, feel free to send me mail.

				- Mike Clark
				  Embry-Riddle Aero. Univ.
				  clarkm@slab.pr.erau.edu




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1993-04-04  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-02 14:48 How to read keys without <CR>, also, simulated GUI? rcbi110
1993-04-04  0:41 ` Michael Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox