accelerator tables and mac

i have a strange problem that only presents itself on a mac with wxpython

i have a main program window, which can open up a second frame containing a text input field. this all works fine until you try to type in the letters o, r, and s. I figured the problem is my code for the accelerator table that im using for main window hotkeys:

self.accel_tbl = wx.AcceleratorTable([

(wx.ACCEL_CTRL, ord(‘O’), ID_OPEN),

(wx.ACCEL_CTRL, ord(‘S’), ID_SAVE),

(wx.ACCEL_CTRL, ord(‘R’), ID_RECOVER),

(wx.ACCEL_NORMAL, ord(‘F’), ID_SKIPFORWARD),

(wx.ACCEL_NORMAL, ord(‘B’), ID_SKIPBACKWARD),

(wx.ACCEL_NORMAL, ord(‘C’), ID_COGCOMMENT),

(wx.ACCEL_NORMAL, ord(‘M’), ID_MUSICCOMMENT),

])

self.SetAcceleratorTable(self.accel_tbl)

in the new frames text field, when i try to type the letter o, i get a dialogue to open a new file. The issue is that the accelerator table specifies CONTROL-o, not just o on its own. I would understand if in the new frame i pressed control-o and it gives me the open window dialogue, but the letter o on its own should be useable

so I try to debug by commenting out the lines in the code above that handles the letters o, s, and r

weirdly, I still get the same problem. pressing o in the text field will just open a window dialogue, even though that line has now been commented out

can anyone see why this might be the case? I have tried different modifiers (instead of CTRL) but same problem. I just need to find a way to get the 3 letters to actually be useable characters in the text field. the other letters specified in the table (f, b, c, m) all work no problem and can be typed into the field (and yes, I have tried changing CTRL to NORMAL like the others…still get the same problem)

Change the acceleration tables to use wx.ACCEL_CMD. This translates to wx.ACCEL_CTRL

on wxMSW and wxGTK and to wx.ACCEL_META (the Apple command key) on

wxMac.

···

On 16 August 2013 10:16, Simon Ho simonsays87@googlemail.com wrote:

i have a strange problem that only presents itself on a mac with wxpython

i have a main program window, which can open up a second frame containing a text input field. this all works fine until you try to type in the letters o, r, and s. I figured the problem is my code for the accelerator table that im using for main window hotkeys:

self.accel_tbl = wx.AcceleratorTable([

(wx.ACCEL_CTRL, ord(‘O’), ID_OPEN),

(wx.ACCEL_CTRL, ord(‘S’), ID_SAVE),

(wx.ACCEL_CTRL, ord(‘R’), ID_RECOVER),

(wx.ACCEL_NORMAL, ord(‘F’), ID_SKIPFORWARD),

(wx.ACCEL_NORMAL, ord(‘B’), ID_SKIPBACKWARD),

(wx.ACCEL_NORMAL, ord(‘C’), ID_COGCOMMENT),

(wx.ACCEL_NORMAL, ord(‘M’), ID_MUSICCOMMENT),

])

self.SetAcceleratorTable(self.accel_tbl)

in the new frames text field, when i try to type the letter o, i get a dialogue to open a new file. The issue is that the accelerator table specifies CONTROL-o, not just o on its own. I would understand if in the new frame i pressed control-o and it gives me the open window dialogue, but the letter o on its own should be useable

so I try to debug by commenting out the lines in the code above that handles the letters o, s, and r

weirdly, I still get the same problem. pressing o in the text field will just open a window dialogue, even though that line has now been commented out

can anyone see why this might be the case? I have tried different modifiers (instead of CTRL) but same problem. I just need to find a way to get the 3 letters to actually be useable characters in the text field. the other letters specified in the table (f, b, c, m) all work no problem and can be typed into the field (and yes, I have tried changing CTRL to NORMAL like the others…still get the same problem)

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.