[pygtk] Handling Control - Shift Key Press Event

Mystilleef mystilleef at gmail.com
Fri May 19 12:36:24 WST 2006


Hello,

I want to handle the (control - shift - s) key press event.
So I do the following in my key press event handler:

def key_press_event_cb(widget, event):
	if event.keyval == ord(s):
		from gtk.gdk import CONTROL_MASK, SHIFT_MASK
		if event.state & CONTROL_MASK | SHIFT_MASK:
			do_something()
			return True
	return False
	
You guessed right, it doesn't work. Any suggestion is
appreciated.

Thanks


More information about the pygtk mailing list