[pygtk] emitting a keypress event with shift modifier

Joshua Immanuel joshua at hipro.co.in
Wed Apr 22 22:54:08 WST 2009


Hello,
I am trying to write a virtual keyboard for multiple languages. I did
the following

event = gtk.gdk.Event(gtk.gdk.KEY_PRESS)
event.keyval = gtk.keysyms.a
event.state = gtk.gdk.SHIFT_MASK
event.window = win.get_root_window()

widget.emit('key-press-event', event)

For the above code I expected the output to be a capital 'A' but what I
got was lower case 'a'

As the virtual keyboard is designed for multiple language i just want
the application to be generic so that if I change the X11's keyboard
layout the key emitted should be in the value in the corresponding language.

Please help me in this regard

regards
-- 
Joshua Immanuel
HiPro IT Solutions Pvt. Ltd.
http://hipro.co.in

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20090422/7d54fb02/attachment.pgp 


More information about the pygtk mailing list