[pygtk] windows vs linux keypress event

Lang Hurst lang at tharin.com
Wed Jul 7 07:44:18 WST 2010


I have this in my program

    def on_window1_key_event(self, widget, event):
         print event

It works fine under linux, the terminal prints out things like

    <gtk.gdk.Event at 0x8b525c0: GDK_KEY_PRESS keyval=Control_L>
    <gtk.gdk.Event at 0x8b525c0: GDK_KEY_PRESS keyval=e>
    <gtk.gdk.Event at 0x8b525c0: GDK_KEY_PRESS keyval=s>

I do other stuff with the key presses, but it works.  When I try to run 
the same program under windows, I get output like

    <gdk.Event at 0xce8640>
    <gdk.Event at 0xce8590>
    <gdk.Event at 0xce8850>


No actual key values come over for me to work with.  Any idea why its 
doing this?  Basically, I capture CNTRL+key and do stuff with it, based 
on the window that's showing.

-Lang

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100706/8c2d6821/attachment.htm 


More information about the pygtk mailing list