comp.lang.ada
 help / color / mirror / Atom feed
* Re: Get_Immediate
       [not found]             ` <340DF1DD.2736@iop.com>
  1997-09-07  0:00               ` Get_Immediate Robert Dewar
@ 1997-09-07  0:00               ` Robert Dewar
  1997-09-08  0:00               ` Get_Immediate J Giffen
  2 siblings, 0 replies; 10+ messages in thread
From: Robert Dewar @ 1997-09-07  0:00 UTC (permalink / raw)




<<I tried using Get_Immediate with GNAT (3.05) on Solaris and I didn't get
the results I wanted.

What I got:

My program reads each key, and I don't have to type Enter, but it also
echoes each key. When I type a key that sends an escape sequence, like
an arrow key, all of the codes in the sequence are echoed, e.g. ^[[A,
before my program gets the first character of the sequence. Also, some
keys, like Ctrl-C did not get read by my program.

What I want:

I want to read without any echoing and be able to get all of the codes
the keyboard can generate.

Can you tell me how to get these results?>>


You probably need to give more detail, what machine are you on? (remember
Solaris does not imply Sparc!)

Also, you need to say what interface you are using, since keyboard input
is often filtered in various ways by the environment. For example, the
situation using X directly on a Sun work station may be radically diferent
from the situation of using a terminal emulator remotely (in the latter
case, the "codes" from the keyboard may be dependent on the terminal
emulator).

If the problem is echoing, then you may well want to use appropriate
OS dependent routines that are around in your environment to do exactly
what you want, using pragma Interface.

But in any case, update to a more recent version, 3.05 is pretty ancient
at this stage!





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

* Re: Get_Immediate
       [not found]             ` <340DF1DD.2736@iop.com>
@ 1997-09-07  0:00               ` Robert Dewar
  1997-09-07  0:00               ` Get_Immediate Robert Dewar
  1997-09-08  0:00               ` Get_Immediate J Giffen
  2 siblings, 0 replies; 10+ messages in thread
From: Robert Dewar @ 1997-09-07  0:00 UTC (permalink / raw)




Jeff said

<<I tried using Get_Immediate with GNAT (3.05) on Solaris and I didn't get
the results I wanted.

What I got:

My program reads each key, and I don't have to type Enter, but it also
echoes each key. When I type a key that sends an escape sequence, like
an arrow key, all of the codes in the sequence are echoed, e.g. ^[[A,
before my program gets the first character of the sequence. Also, some
keys, like Ctrl-C did not get read by my program.

What I want:

I want to read without any echoing and be able to get all of the codes
the keyboard can generate.

Can you tell me how to get these results?>>


GNAT 3.05 is very far out of date, get a more recent version.





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

* Re: Get_Immediate
       [not found]             ` <340DF1DD.2736@iop.com>
  1997-09-07  0:00               ` Get_Immediate Robert Dewar
  1997-09-07  0:00               ` Get_Immediate Robert Dewar
@ 1997-09-08  0:00               ` J Giffen
  2 siblings, 0 replies; 10+ messages in thread
From: J Giffen @ 1997-09-08  0:00 UTC (permalink / raw)
  To: Jeff Glenn


Jeff Glenn wrote:
> 
> Mr. Dewar,
> 
> I tried using Get_Immediate with GNAT (3.05) on Solaris and I didn't get
> the results I wanted.
> 
> What I got:
> 
> My program reads each key, and I don't have to type Enter, but it also
> echoes each key. When I type a key that sends an escape sequence, like
> an arrow key, all of the codes in the sequence are echoed, e.g. ^[[A,
> before my program gets the first character of the sequence. Also, some
> keys, like Ctrl-C did not get read by my program.
> 
> What I want:
> 
> I want to read without any echoing and be able to get all of the codes
> the keyboard can generate.
> 
> Can you tell me how to get these results?
> 
> Thanks!
> 
> Jeff Glenn
> 
> jeff@iop.com

It sounds like the computer's sampling rate to the keyboard is faster
than what the program is willing to accomodate.  This might be solved
by going into CMOS Setup and altering the keyboard sampling rate.  I'd
try slowing it down some.

ASCII for cursor right, left, up and down is 1C, 1D, 1E & 1F.  Other
keys have others.  A switch closure for a certain row and column on
the keyboard is picked up when a scanning frequency detects it and
sends the signal to the motherboard.




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

* Get_Immediate
@ 2003-12-10 16:00 Xavier Serrand
  2003-12-10 18:33 ` Get_Immediate tmoran
  2003-12-10 18:44 ` Get_Immediate Jeffrey Carter
  0 siblings, 2 replies; 10+ messages in thread
From: Xavier Serrand @ 2003-12-10 16:00 UTC (permalink / raw)


Hello,

I have to work with Ada 83 .... and,
I have to use the functionnality of Get_Immediate (return immediately
after the keystroke and no echo)

I tried to interface with c (getch)... it works fine ... with Ada
95...
I can't interface with Ada 83 ... because i have none of the specific
package to do this work ...

Could somebody give me a better idea if it's no possibility to find
old packages to interface with c ...

xavier SERRAND



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

* Re: Get_Immediate
  2003-12-10 16:00 Get_Immediate Xavier Serrand
@ 2003-12-10 18:33 ` tmoran
  2003-12-11  2:32   ` Get_Immediate Xavier Serrand
  2003-12-10 18:44 ` Get_Immediate Jeffrey Carter
  1 sibling, 1 reply; 10+ messages in thread
From: tmoran @ 2003-12-10 18:33 UTC (permalink / raw)


> I have to work with Ada 83 .... and,
> I have to use the functionnality of Get_Immediate (return immediately
> after the keystroke and no echo)
   Your Ada 83 compiler almost surely came with a library with the
routine you want, and a way (not exactly the Ada 95 way, obviously)
to interface with other code in other languages.  What compiler
are you using?



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

* Re: Get_Immediate
  2003-12-10 16:00 Get_Immediate Xavier Serrand
  2003-12-10 18:33 ` Get_Immediate tmoran
@ 2003-12-10 18:44 ` Jeffrey Carter
  2004-01-23 16:03   ` Get_Immediate mla154
  1 sibling, 1 reply; 10+ messages in thread
From: Jeffrey Carter @ 2003-12-10 18:44 UTC (permalink / raw)


Xavier Serrand wrote:

> I have to work with Ada 83 .... and,
> I have to use the functionnality of Get_Immediate (return immediately
> after the keystroke and no echo)
> 
> I tried to interface with c (getch)... it works fine ... with Ada
> 95...
> I can't interface with Ada 83 ... because i have none of the specific
> package to do this work ...
> 
> Could somebody give me a better idea if it's no possibility to find
> old packages to interface with c ...

Your compiler vendor probably supplies a package with this capability, 
or that allows you to create this functionality. I wrote a keyboard 
package for DOS in Ada 83 that provided this functionality using a 
vendor-supplied package to make DOS calls.

You should also be able to import getch using pragma Interface in Ada 83:

function Getch ...;
pragma Interface (C, Getch);

Many compilers also supported pragma Interface_Name to supply the 3rd 
parameter of pragma Import:

pragma Interface_Name (Getch, "getch"); -- IIRC

-- 
Jeff Carter
"Perfidious English mouse-dropping hoarders."
Monty Python & the Holy Grail
10




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

* Re: Get_Immediate
  2003-12-10 18:33 ` Get_Immediate tmoran
@ 2003-12-11  2:32   ` Xavier Serrand
  2003-12-11  7:37     ` Get_Immediate tmoran
  0 siblings, 1 reply; 10+ messages in thread
From: Xavier Serrand @ 2003-12-11  2:32 UTC (permalink / raw)


tmoran@acm.org wrote in message news:<kGJBb.497056$Tr4.1353908@attbi_s03>...
> > I have to work with Ada 83 .... and,
> > I have to use the functionnality of Get_Immediate (return immediately
> > after the keystroke and no echo)
>    Your Ada 83 compiler almost surely came with a library with the
> routine you want, and a way (not exactly the Ada 95 way, obviously)
> to interface with other code in other languages.  What compiler
> are you using?

Hello Mister Moran,
I'm using Gnat 3.14 ... for Ada 95 ... and I will have to port my work
on another station where i'll have to use Ada 83 ...
I think i'll see how it's done with gnat ...



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

* Re: Get_Immediate
  2003-12-11  2:32   ` Get_Immediate Xavier Serrand
@ 2003-12-11  7:37     ` tmoran
  2003-12-11 15:38       ` Get_Immediate Robert A Duff
  0 siblings, 1 reply; 10+ messages in thread
From: tmoran @ 2003-12-11  7:37 UTC (permalink / raw)


> I'm using Gnat 3.14 ... for Ada 95 ... and I will have to port my work
> on another station where i'll have to use Ada 83 ...
> I think i'll see how it's done with gnat ...
   How it's done today in Gnat is not going to tell you much about how
it was done years ago with your old Ada 83 compiler.



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

* Re: Get_Immediate
  2003-12-11  7:37     ` Get_Immediate tmoran
@ 2003-12-11 15:38       ` Robert A Duff
  0 siblings, 0 replies; 10+ messages in thread
From: Robert A Duff @ 2003-12-11 15:38 UTC (permalink / raw)


tmoran@acm.org writes:

>    How it's done today in Gnat is not going to tell you much about how
> it was done years ago with your old Ada 83 compiler.

For Ada-calling-C, it's pretty similar, but the name of the pragma was
Interface in Ada 83 (now called Import in Ada 95).

Ada 83 did not support C-calling-Ada, nor inter-language data references
(although some compilers supported those things).

The OP should look up pragma Interface in the Ada 83 manual, and also in
the manual for the compiler.

- Bob



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

* Re: Get_Immediate
  2003-12-10 18:44 ` Get_Immediate Jeffrey Carter
@ 2004-01-23 16:03   ` mla154
  0 siblings, 0 replies; 10+ messages in thread
From: mla154 @ 2004-01-23 16:03 UTC (permalink / raw)


Following your suggestions, Jeff, the program compiled with no errors.  However, when I ran the program, the getch appears not to accept the pressing of the 'Enter' key.  Do you have any suggestions?




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

end of thread, other threads:[~2004-01-23 16:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-10 16:00 Get_Immediate Xavier Serrand
2003-12-10 18:33 ` Get_Immediate tmoran
2003-12-11  2:32   ` Get_Immediate Xavier Serrand
2003-12-11  7:37     ` Get_Immediate tmoran
2003-12-11 15:38       ` Get_Immediate Robert A Duff
2003-12-10 18:44 ` Get_Immediate Jeffrey Carter
2004-01-23 16:03   ` Get_Immediate mla154
  -- strict thread matches above, loose matches on Subject: below --
1997-08-21  0:00 floating point comparison Robert Dewar
1997-08-22  0:00 ` Jim Carr
1997-08-22  0:00   ` Robert Dewar
1997-08-23  0:00     ` Jim Carr
1997-08-24  0:00       ` Robert Dewar
1997-08-29  0:00         ` Andrew V. Nesterov
1997-08-29  0:00           ` Robert Dewar
     [not found]             ` <340DF1DD.2736@iop.com>
1997-09-07  0:00               ` Get_Immediate Robert Dewar
1997-09-07  0:00               ` Get_Immediate Robert Dewar
1997-09-08  0:00               ` Get_Immediate J Giffen

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