Use command key in menu accelerator

HI,

I am trying to use command key in menu accelerator on MAC OSX, for example:

myMenu = wx.Menu()

myMenu.Append(101, “Open\tCMD+O”, “”, wx.ITEM_NORMAL)

however I always get this error:

[Debug] 20:57:03: Unknown accel modifier: ‘cmd’

I also tried “Open\tCOMMAND+O” but get the same error.

I am using python 2.7.3 (32bit) + wxpython 2.8.12.1

Any suggestion?

H.J

For Mac the CTRL- menu key modifier is automatically the same as
Command, (don't use mac so not sure how it is displayed), so just use
that on the latest wxPython 2.9.4 preview apparently you can use
RawCtrl- if you need a key to be bound to Control on all platforms and
not to Command on macs.

···

On 14/07/2012 5:07 AM, Hu Jun wrote:

HI,
I am trying to use command key in menu accelerator on MAC OSX, for
example:
        myMenu = wx.Menu()
        myMenu.Append(101, "Open\tCMD+O", "", wx.ITEM_NORMAL)
however I always get this error:
[Debug] 20:57:03: Unknown accel modifier: 'cmd'

I also tried "Open\tCOMMAND+O" but get the same error.

I am using python 2.7.3 (32bit) + wxpython 2.8.12.1

Any suggestion?

H.J
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Thanks, it works, it display as “CMD+O” in the menu, but it seem wxpython 2.8 doesn’t support “RawCtrl”, so is there any way to bound ctrl key on MAC with wxpython 2.8?

···

On Friday, July 13, 2012 11:46:47 PM UTC-7, Gadget Steve wrote:

For Mac the CTRL- menu key modifier is automatically the same as

Command, (don’t use mac so not sure how it is displayed), so just use

that on the latest wxPython 2.9.4 preview apparently you can use

RawCtrl- if you need a key to be bound to Control on all platforms and

not to Command on macs.

AFAIK Keys bound this way should work for both keys on wxPython 2.8 only
on on 2.9 do you get the choice. Of course using the separate keys makes
the code Mac specific which kind of defeats the object of using a cross
platform GUI library... :frowning:

···

On 14/07/2012 4:41 PM, Hu Jun wrote:

Thanks, it works, it display as "CMD+O" in the menu, but it seem
wxpython 2.8 doesn't support "RawCtrl", so is there any way to bound
ctrl key on MAC with wxpython 2.8?

In my case, “CTRL+O” only bind to command key …

IMHO, cross platform or not, it is always good to have choice

···

On Saturday, July 14, 2012 9:36:28 AM UTC-7, Gadget Steve wrote:

On 14/07/2012 4:41 PM, Hu Jun wrote:

Thanks, it works, it display as “CMD+O” in the menu, but it seem

wxpython 2.8 doesn’t support “RawCtrl”, so is there any way to bound

ctrl key on MAC with wxpython 2.8?

AFAIK Keys bound this way should work for both keys on wxPython 2.8 only

on on 2.9 do you get the choice. Of course using the separate keys makes

the code Mac specific which kind of defeats the object of using a cross

platform GUI library… :frowning: