* Re: help abut function keys
1998-08-06 0:00 help abut function keys jtapasai
@ 1998-08-06 0:00 ` Jerry van Dijk
1998-08-12 0:00 ` Do-While Jones
1 sibling, 0 replies; 3+ messages in thread
From: Jerry van Dijk @ 1998-08-06 0:00 UTC (permalink / raw)
jtapasai@my-dejanews.com wrote:
: I am learning ADA with GNAT 3.10 under Linux and my problem is :
: I usually used a function that returns an integer wich is the ASCII code
: of the pressed key. When the code is returned , I use a case when ...
: However, the F-keys have an special code.
: For example, F1 is ^]]A wich is 91 27 27 65 or something similar .
The 'special' key's on a PC's keyboard have no ansi code. Also, since
you are using linux, there is not even a garantee that the keyboard
used is in fact a PC keyboard. I'm writing this on a VT220 clone.
Assuming you can be sure your program will only run on a PC console
you can either use nested case statements to filter out the proper
keys, or write your own keyboard input function using your own
keyboard code type.
Jerry.
--
-- Jerry van Dijk | email: jdijk@acm.org
-- Leiden, Holland | member Team-Ada
-- Ada & Win32: http://stad.dsl.nl/~jvandyk
^ permalink raw reply [flat|nested] 3+ messages in thread
* help abut function keys
@ 1998-08-06 0:00 jtapasai
1998-08-06 0:00 ` Jerry van Dijk
1998-08-12 0:00 ` Do-While Jones
0 siblings, 2 replies; 3+ messages in thread
From: jtapasai @ 1998-08-06 0:00 UTC (permalink / raw)
I am learning ADA with GNAT 3.10 under Linux and my problem is :
I have a menu with different options. Each option is executed when
a key is pressed. My problem us that those keys are necessarily
"special keys", such as function keys ( F1-F12);
I usually used a function that returns an integer wich is the ASCII code
of the pressed key. When the code is returned , I use a case when ...
However, the F-keys have an special code.
For example, F1 is ^]]A wich is 91 27 27 65 or something similar .
How can I solve it ?
Thanks in advance .
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: help abut function keys
1998-08-06 0:00 help abut function keys jtapasai
1998-08-06 0:00 ` Jerry van Dijk
@ 1998-08-12 0:00 ` Do-While Jones
1 sibling, 0 replies; 3+ messages in thread
From: Do-While Jones @ 1998-08-12 0:00 UTC (permalink / raw)
In article <6qbvh5$2un$1@nnrp1.dejanews.com>,
<jtapasai@my-dejanews.com> wrote:
>I am learning ADA with GNAT 3.10 under Linux and my problem is :
>I have a menu with different options. Each option is executed when
>a key is pressed. My problem us that those keys are necessarily
>"special keys", such as function keys ( F1-F12);
>
>I usually used a function that returns an integer wich is the ASCII code
>of the pressed key. When the code is returned , I use a case when ...
>However, the F-keys have an special code.
>For example, F1 is ^]]A wich is 91 27 27 65 or something similar .
>How can I solve it ?
>Thanks in advance .
>
I did something like this 10 years ago for my VIRTUAL_TERMINAL package.
The body for the Meridian compiler on an IBM PC/AT is in
ftp://www.ridgenet.net/pub/users/d/do_while/ada_in_action/disk2/
meridian/vtbmibm.ada
The "get" procedure will show you the general approach.
VIRTUAL_TERMINAL is one of the many examples from my book, Ada in Action.
You can find it at
http://www.cs.kuleuven.ac.be/~dirk/ada-belgium/aia/contents.html
I hope this helps you.
Do-While Jones
+--------------------------------+
| Know Ada |
| [Ada's Portrait] |
| Will Travel |
| wire do_while@ridgecrest.ca.us |
| www.ridgenet.net/~do_while |
+--------------------------------+
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-08-12 0:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-06 0:00 help abut function keys jtapasai
1998-08-06 0:00 ` Jerry van Dijk
1998-08-12 0:00 ` Do-While Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox