How do I bind a key to Mac Command keys?

Thanks I'll try that. Which leads to obvious follow up.

How do I bind to ALT on the Mac? :slight_smile:

Barry

路路路

On Jun 22, 2004, at 18:55, Robin Dunn wrote:

Barry Scott wrote:

To be Mac like app I need to bind to Mac Command prefixed keys in
the accelerator table. But I cannot find a wx.ACCEL_ symbol to use.
How do I do it?

Try using wxACCEL_ALT. This should probably be changed but it looks like wxMac's accelerator code is equating them, (meta is the Cmd key):

        if ((event.m_keyCode == entry->GetKeyCode()) &&
           (((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) &&
           (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) &&
           (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown()))
        {
            return entry->GetCommand();
        }

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org