Thread: [Python]Run a widget without window being focussed
hi hav written code in pygtk captures keys user presses while widget running..but when in focus...so thre can make run without in focus....???
code is
code:import pygtk,gtk def on_key_press_event(widget, event): keyname = gtk.gdk.keyval_name(event.keyval) print "key %s (%d) pressed" % (keyname, event.keyval) w = gtk.window() w.connect('key_press_event', on_key_press_event) w.show_all() w.connect("destroy",lambda wid:gtk.main_quit()) gtk.main()
not gtk+. think this: gtk.main() running in context of program, catch signals program gets... nothing else.
have interface x server, system component in charge of detecting keypresses in graphical display session. @ this: http://www.larsen-b.com/article/184.html
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [Python]Run a widget without window being focussed
Ubuntu

Comments
Post a Comment