From a5c1f8ca21e458661410d5019aea45134ccd0569 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 28 Jun 2003 06:59:30 +0000 Subject: [PATCH] function key support git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/uma.cpp | 61 +++--------------------------------------- src/mac/uma.cpp | 61 +++--------------------------------------- 2 files changed, 8 insertions(+), 114 deletions(-) diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index a561674ed2..c8073ac49f 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -292,68 +292,15 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn SInt16 macKey = key ; if ( key >= WXK_F1 && key <= WXK_F15 ) { - macKey = kFunctionKeyCharCode ; + // for some reasons this must be 0 right now + // everything else leads to just the first function key item + // to be selected. Thanks to Ryan Wilcox for finding out. + macKey = 0 ; glyph = kMenuF1Glyph + ( key - WXK_F1 ) ; if ( key >= WXK_F13 ) glyph += 13 ; if ( !explicitCommandKey ) modifiers |= kMenuNoCommandModifier ; - - switch( key ) - { - case WXK_F1 : - macKey += ( 0x7a << 8 ) ; - break ; - case WXK_F2 : - macKey += ( 0x78 << 8 ) ; - break ; - case WXK_F3 : - macKey += ( 0x63 << 8 ) ; - break ; - case WXK_F4 : - macKey += ( 0x76 << 8 ) ; - break ; - case WXK_F5 : - macKey += ( 0x60 << 8 ) ; - break ; - case WXK_F6 : - macKey += ( 0x61 << 8 ) ; - break ; - case WXK_F7 : - macKey += ( 0x62 << 8 ) ; - break ; - case WXK_F8 : - macKey += ( 0x64 << 8 ) ; - break ; - case WXK_F9 : - macKey += ( 0x65 << 8 ) ; - break ; - case WXK_F10 : - macKey += ( 0x6D << 8 ) ; - break ; - case WXK_F11 : - macKey += ( 0x67 << 8 ) ; - break ; - case WXK_F12 : - macKey += ( 0x6F << 8 ) ; - break ; - case WXK_F13 : - macKey += ( 0x69 << 8 ) ; - break ; - case WXK_F14 : - macKey += ( 0x6B << 8 ) ; - break ; - case WXK_F15 : - macKey += ( 0x71 << 8 ) ; - break ; - default : - break ; - } ; - // unfortunately this does not yet trigger the right key , - // for some reason mac justs picks the first function key menu - // defined, so we turn this off - macKey = 0 ; - glyph = 0 ; } else { diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index a561674ed2..c8073ac49f 100644 --- a/src/mac/uma.cpp +++ b/src/mac/uma.cpp @@ -292,68 +292,15 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn SInt16 macKey = key ; if ( key >= WXK_F1 && key <= WXK_F15 ) { - macKey = kFunctionKeyCharCode ; + // for some reasons this must be 0 right now + // everything else leads to just the first function key item + // to be selected. Thanks to Ryan Wilcox for finding out. + macKey = 0 ; glyph = kMenuF1Glyph + ( key - WXK_F1 ) ; if ( key >= WXK_F13 ) glyph += 13 ; if ( !explicitCommandKey ) modifiers |= kMenuNoCommandModifier ; - - switch( key ) - { - case WXK_F1 : - macKey += ( 0x7a << 8 ) ; - break ; - case WXK_F2 : - macKey += ( 0x78 << 8 ) ; - break ; - case WXK_F3 : - macKey += ( 0x63 << 8 ) ; - break ; - case WXK_F4 : - macKey += ( 0x76 << 8 ) ; - break ; - case WXK_F5 : - macKey += ( 0x60 << 8 ) ; - break ; - case WXK_F6 : - macKey += ( 0x61 << 8 ) ; - break ; - case WXK_F7 : - macKey += ( 0x62 << 8 ) ; - break ; - case WXK_F8 : - macKey += ( 0x64 << 8 ) ; - break ; - case WXK_F9 : - macKey += ( 0x65 << 8 ) ; - break ; - case WXK_F10 : - macKey += ( 0x6D << 8 ) ; - break ; - case WXK_F11 : - macKey += ( 0x67 << 8 ) ; - break ; - case WXK_F12 : - macKey += ( 0x6F << 8 ) ; - break ; - case WXK_F13 : - macKey += ( 0x69 << 8 ) ; - break ; - case WXK_F14 : - macKey += ( 0x6B << 8 ) ; - break ; - case WXK_F15 : - macKey += ( 0x71 << 8 ) ; - break ; - default : - break ; - } ; - // unfortunately this does not yet trigger the right key , - // for some reason mac justs picks the first function key menu - // defined, so we turn this off - macKey = 0 ; - glyph = 0 ; } else { -- 2.45.2