[wxpython-users] MORE on Keyboard bug.

Phillip Watts phillip.watts at anvilcom.com
Thu May 1 06:43:52 PDT 2008


I thought I had identified a bug a few days ago
BUT its only in one environment.

In the following program pressing pagedown and
pageup gives event.GetKeyCode()  --  312 and 313.

./keybtest.py
312
313

But ONLY on Kubuntu/KDE.  Everywhere else its 366, 367.
Ideas?

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# generated by wxGlade 0.4.1 on Tue Apr 22 15:35:58 2008

import wx

class MyFrame(wx.Frame):
    def __init__(self, *args, **kwds):
	print 'init'
        # begin wxGlade: MyFrame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.text_ctrl_1 = wx.TextCtrl(self, -1, "", 
style=wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB)

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: MyFrame.__set_properties
        self.SetTitle("frame_1")
	self.SetSize( (200,100) )
        self.SetFocus()
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: MyFrame.__do_layout
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_1.Add(self.text_ctrl_1, 0, wx.ADJUST_MINSIZE, 0)
        self.SetAutoLayout(True)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        sizer_1.SetSizeHints(self)
        self.Layout()
        # end wxGlade

# end of class MyFrame

def prockey(event):
    k = event.GetKeyCode()
    print k

app = wx.App() 
f = MyFrame(None,-1)

f.text_ctrl_1.Bind(wx.EVT_KEY_DOWN, prockey)

f.text_ctrl_1.SetFocus()
f.Show()
app.MainLoop()



More information about the wxpython-users mailing list