Re: Key bindings?
| From: | (Aaron Bishell) | Date: | Sun, 29 Dec 2002 23:15:44 +0000 |
| Subject: | Re: Key bindings? | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2821@lists.php.net to get a copy of this message | ||
Sorry I misundetstood your question, ignore my previous post. Im not sure
how you would capture keyboard events as ive never done it before but I
did find this:
http://gtk.php.net/manual/en/gtk.gtkwidget.signal.key-press-event.php
Hope that helps.
Aaron Bishell wrote:
> /* The function that is called when the 1 button is pressed */
> function to_do_when_one_is_clicked ()
> {
> //...
> }
> /* Define your button */
> $the_one_widget=new GtkButton("1");
> /* Connect your button */
> $the_one_widget->connect("clicked", "to_do_when_one_is_clicked");
> There are also a number of other signals you may find useful. They can be
> found here: http://gtk.php.net/manual/en/gtk.gtkbutton.php
> Benjamin Smith wrote:
> > Learning GTK and GUI programming with PHP-GTK, to leverage my experience
> with PHP. (Love it so far!)
> > How do I bind keys to the click/press of a widget?
> > For example, I'm writing a calculator. How do a "click" the 1 widget when I
> press a "1" on the keyboard?
> > Thanks,
> > -Ben
> > - The best way to predict the future is to invent it. -