Don't add NSFunctionKeyMask to NSMenuItem modifiers.

This code probably misunderstood NSEvent documentation, where this mask is
mentioned, but setKeyEquivalentModifierMask: documentation doesn't list it as
allowed. More importantly, it causes "fn" to appear in the menu item and the
accelerator doesn't work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2013-11-23 15:09:51 +00:00
parent bae200a453
commit 6814e0ea4b

View File

@ -153,7 +153,6 @@ void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry*
unichar shortcut = 0;
if ( key >= WXK_F1 && key <= WXK_F15 )
{
modifiers |= NSFunctionKeyMask ;
shortcut = NSF1FunctionKey + ( key - WXK_F1 );
}
else
@ -161,47 +160,42 @@ void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry*
switch ( key )
{
case WXK_CLEAR :
modifiers |= NSFunctionKeyMask;
shortcut = NSDeleteCharacter ;
break ;
case WXK_PAGEUP :
modifiers |= NSFunctionKeyMask;
shortcut = NSPageUpFunctionKey ;
break ;
case WXK_PAGEDOWN :
modifiers |= NSFunctionKeyMask;
shortcut = NSPageDownFunctionKey ;
break ;
case WXK_LEFT :
modifiers |= NSNumericPadKeyMask | NSFunctionKeyMask;
modifiers |= NSNumericPadKeyMask;
shortcut = NSLeftArrowFunctionKey ;
break ;
case WXK_UP :
modifiers |= NSNumericPadKeyMask | NSFunctionKeyMask;
modifiers |= NSNumericPadKeyMask;
shortcut = NSUpArrowFunctionKey ;
break ;
case WXK_RIGHT :
modifiers |= NSNumericPadKeyMask | NSFunctionKeyMask;
modifiers |= NSNumericPadKeyMask;
shortcut = NSRightArrowFunctionKey ;
break ;
case WXK_DOWN :
modifiers |= NSNumericPadKeyMask | NSFunctionKeyMask;
modifiers |= NSNumericPadKeyMask;
shortcut = NSDownArrowFunctionKey ;
break ;
case WXK_HOME :
modifiers |= NSFunctionKeyMask;
shortcut = NSHomeFunctionKey ;
break ;
case WXK_END :
modifiers |= NSFunctionKeyMask;
shortcut = NSEndFunctionKey ;
break ;