comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: key strokes intercept
Date: 1999/03/31
Date: 1999-03-31T00:00:00+00:00	[thread overview]
Message-ID: <usoaligky.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 370160f9.569041534@news.dsuper.net

fluffy_puff@dsuper.net writes:

> Hi,
> 
> I'm taking a programming course, using Ada 95, and I've played with VB
> and C++ before.  In Visual Basic I could use some pre-defined
> subprograms to control key strokes in real time (as they happened, as
> opposed to after the <Return> key has been pressed): KeyDown, KeyUp,
> KeyCode, stuff like that.

KeyDown, KeyUp, KeyCode etc are Windows events. Visual Basic provides
a nice framework for handling events nicely. Plain Ada does not; you
need a thick binding to Windows to get that. I'm writing one called
Windex; after you learn some more about Ada, you could try it. See my
web page:

http://www.erols.com/leakstan/Stephe/index.html

The version there now does not provide access to the Key events, but I
just added that over the weekend, so check back soon (I'll announce
here when I release a new version). In the meantime, it will give you
a taste of what you are in for; don't be too scared, it gets easier
after you learn more. Look at the example Mandelplot application, not
the Windex code itself. It has handlers for mouse events; key events
will work similarly.

> 
> How do I do this in Ada ?  I just need sort of a starting point where
> I can look for the info.  I have a beginner level book that's pretty
> good but doesn't touch this topic at all.  I couldn't find anything
> either in the online help I have.

You need to get a good intro to Windows. I recommend Charles Petzold's
book (I think the title is "Programming Windows 95"). This will
explain about Windows events etc.
 
> What is "GNAT" ?

A free Ada compiler; you can download it from
ftp://cs.nyu.edu/pub/gnat/. For the Windows version, see the winnt/
directory; works nicely for Windows NT and Windows 95; should work
with Windows 98.

> All I can say about the compiler I use is what the "About" box shows:
> ObjectAda for Windows V7.1.105 (special edition)
> Copyright (c) 1997, Aonix.

This is another free Ada compiler, but it has several limitations (it
is old, has some known bugs, and will only compile relatively small
programs). I recommend downloading Gnat; it has a nice install script,
and is in some ways better than even the current version of ObjectAda.
On the other hand, Aonix does make a GUI builder that is trying to be
like Visual Basic (it has a _long_ way to go), so if you're interested
in helping them along, go buy the version of ObjectAda that provides
the GUIBuilder. Check their website at: www.aonix.com (hmm, doesn't
seem to be up right now).

> Thanks

You're welcome; hope this helps.

-- Stephe




  parent reply	other threads:[~1999-03-31  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-30  0:00 key strokes intercept fluffy_puff
1999-03-30  0:00 ` Matthew Heaney
1999-03-30  0:00   ` Magnus Larsson
1999-03-30  0:00     ` Tom Moran
1999-03-30  0:00   ` Marin David Condic
1999-04-01  0:00     ` Aidan Skinner
1999-04-05  0:00       ` Marin David Condic
1999-03-31  0:00   ` fluffy_bud
1999-03-30  0:00 ` David C. Hoos, Sr.
1999-03-31  0:00   ` fluffy_bud
1999-04-01  0:00     ` Aidan Skinner
1999-03-31  0:00 ` Stephen Leake [this message]
1999-04-01  0:00   ` fluffy_doo
1999-04-01  0:00     ` Tom Moran
1999-04-02  0:00     ` Jerry van Dijk
replies disabled

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