PDA

View Full Version : gtkmm keyboard input


evster
January 11th, 2007, 04:05 PM
Hello,

I am writing my first gtkmm program. I have made many gui programs in other languages (mostly on windows), but I am having trouble figuring out how to get keyboard events. For example, if someone presses 'esc' i want the program to exit. Could anyone point me to some examples of this?

Thanks!
evster

jblebrun
January 11th, 2007, 11:30 PM
Have you learned about signals in GTK, yet? What you probably want is a keypress_event sort of signal Check out the gtkmm docs and search around for more information about signals:

http://www.gtkmm.org/docs/gtkmm-2.4/docs/
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/apb.html