comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: GtkAda or Ada or a binding?  Keys
Date: Mon, 24 Sep 2001 13:43:15 GMT
Date: 2001-09-24T13:43:15+00:00	[thread overview]
Message-ID: <TLGr7.2948$ev2.1768@www.newsranger.com> (raw)
In-Reply-To: 3BAEE03A.3DDB8E2F@nbi.dk

In article <3BAEE03A.3DDB8E2F@nbi.dk>, Jacob Sparre Andersen says...
>
>Chris:
>
>> Does GtkAda have any support for getting key presses from the user?
>
>You might want to look at Ada.Text_IO.Get_Immediate.

Unfortunately, on many OS's the user still would have to have pressed the Enter
key before keypresses are available to Get_Immediate. If your OS is one of
those, then you would have to make some sort of system call to get keypresses.

Most window managers come with a way to do this. Gtk is no exception. What you'd
want to do is set your application up to receive keypress events (GdkEvents of
type GdkEventKey). You could also probably do it with menu accelerator keys, but
that seems a bit cheesy. You can set button press and button release events for
any "Widget". If I'm remembering my Gtk+ properly, you'd probably want to set it
for your outermost-container, but its probably something that you'd have to play
with a bit.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



  reply	other threads:[~2001-09-24 13:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-23 15:36 GtkAda or Ada or a binding? Keys chris.danx
2001-09-24  7:26 ` Jacob Sparre Andersen
2001-09-24 13:43   ` Ted Dennison [this message]
2001-09-24  9:23 ` Emmanuel Briot
2001-09-24 20:14 ` David Botton
2001-09-24 20:27   ` Preben Randhol
2001-09-25 18:41     ` David Botton
     [not found]     ` <00af01c145f1$a9cd8d60$0100a8c0@DBINSPIRON>
2001-09-25 20:10       ` David Botton
2001-09-24 20:51   ` chris.danx
2001-09-28 22:43     ` Stefan Skoglund
2001-09-29 11:39       ` Aidan Skinner
2001-09-25 18:09   ` tmoran
2001-09-25 19:48   ` chris.danx
2001-09-25 20:09     ` David Botton
2001-09-25 20:59       ` chris.danx
2001-09-26 17:23       ` Sergey Koshcheyev
2001-09-25  4:48 ` Bobby D. Bryant
2001-09-28 22:32 ` Stefan Skoglund
2001-09-28 22:41 ` Stefan Skoglund
2001-09-28 22:45 ` Stefan Skoglund
replies disabled

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