[pygtk] Evaluation key combinations

Lang Hurst lang at tharin.com
Wed Jun 20 01:03:59 WST 2012


I wrote a little app awhile ago which used a bunch of hotkeys 
(shortcuts, whatever they are called) like CTRL-G, ALT-N, etc.  I used 
something very similar to this code:

  if event.state & gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK:

and so on.  I'm trying to re-write my old application using pyGObject 
and am getting errors referencing no gdk module.  Is there a quick way 
of just doing:

if CTRL-B is pressed:
      do_something()

Thanks.


More information about the pygtk mailing list