wxPython Demo: 'Grid - Remapping keys to behave differently ' the grid accept Chinese chars problem

Hi,

I’m using the grid demo “Remapping keys to behave differently”. I found that when I input more than one Chinese characters using just one code (at most 4 key strokes), the cell changed to ‘edit-enabled’ successfully, but just the first character was inputted in. I modified the demo like this:

def OnKeyDown(self, evt):

if evt.GetKeyCode() != wx.WXK_RETURN:

self.EnableCellEditControl() ## I added the line

evt.Skip()

return

if evt.ControlDown():

evt.Skip()

return

self.DisableCellEditControl()

It worked. But when I input Non Chinese, I need one more stroke to enable editting now.

How can I solve the problem perfectly?

Thanks in advance.

2009-03-20

···

artman328