From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c9451537593407b7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-24 06:43:34 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <0onr7.9325$Ck.1581110@news6-win.server.ntlworld.com> <3BAEE03A.3DDB8E2F@nbi.dk> Subject: Re: GtkAda or Ada or a binding? Keys Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Mon, 24 Sep 2001 09:43:15 EDT Organization: http://www.newsranger.com Date: Mon, 24 Sep 2001 13:43:15 GMT Xref: archiver1.google.com comp.lang.ada:13281 Date: 2001-09-24T13:43:15+00:00 List-Id: 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