From: "Stefan Csomor" on
Hi Ryan

thank you for pointing out this issue

> Today I was playing with wxAcceleratorTable. The wxBook(p.180) says:
> "Note that on OS X, a shortcut specification involving
> Ctrl will actually use the Command key"
>
> I tested this assertion out, and proved it false!

no the sentence is correct, in the paragraph it stands, it still relates
to the string of a menu command, like

"Copy\tCtrl+C"

But the same is not true with wxAcceleratorEntry. There the match is
different, rather a 1:1 for ctrl

> wxAcceleratorEntry *entry = node->GetData();
> 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();
> }

for accelerators it makes sense to me to have the 1:1 test, as you can
do with the wxKeyEvent, so I wouldn't interpret ctrl as meta on mac, but
of course sometimes you want to indicate even accelerator keys that
would be different on the platforms. IMHO the cleanest solutions would
be to offer a wxACCEL_CMD which would be META on mac and CTRL on other
platforms ?

Btw : there is no wxACCEL_META defines, should it be ?

Thoughts, opinions,

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Ryan Wilcox on
On 8/28/06, at 7:26 AM, Stefan Csomor said:


>for accelerators it makes sense to me to have the 1:1 test, as you
>can do with the wxKeyEvent, so I wouldn't interpret ctrl as meta on
>mac...

>Btw : there is no wxACCEL_META defines, should it be ?

I tried this, but no dice: compiler complained that it was not found. Using _META would make sense to me partially, but if you _wanted_ the translation from Command -> Control for your accelerator then you're stuck.

HTH,
_Ryan Wilcox

--
Wilcox Development Solutions: <http://www.wilcoxd.com>
Toolsmiths for the Internet Age PGP: 0x2F4E9C31

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Robin Dunn on
Stefan Csomor wrote:
> IMHO the cleanest solutions would
> be to offer a wxACCEL_CMD which would be META on mac and CTRL on other
> platforms ?

+1

It makes sense to me, and would match what we do elsewhere with
event.CmdDown(). Or perhaps it would make sense to have a wxACCEL_CMD
that has a unique value (instead of being equivallent to either META or
CTRL) and just have it check event.CmdDown() and let the mapping happen
there.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "Stefan Csomor" on
Hi

> It makes sense to me, and would match what we do elsewhere
> with event.CmdDown(). Or perhaps it would make sense to have
> a wxACCEL_CMD that has a unique value (instead of being
> equivallent to either META or
> CTRL) and just have it check event.CmdDown() and let the
> mapping happen there.

I think it should map the modifiers somehow, although as I said a
wxACCEL_META does not exist (Reasons ?)

Best,

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

 | 
Pages: 1
Prev: Seperate Event Handler
Next: from DLL events