diff options
-rw-r--r-- | svtools/source/misc/acceleratorexecute.cxx | 6 | ||||
-rw-r--r-- | toolkit/source/awt/vclxmenu.cxx | 5 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 2 | ||||
-rwxr-xr-x | vcl/aqua/source/app/vclnsapp.mm | 20 | ||||
-rw-r--r-- | vcl/inc/vcl/accel.h | 2 | ||||
-rw-r--r-- | vcl/inc/vcl/cmdevt.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/vcl/event.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/vcl/keycod.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/vcl/keycodes.hxx | 3 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/accel.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/keycod.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/keyevent.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/mouseevent.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 27 | ||||
-rw-r--r-- | vcl/unx/source/window/salframe.cxx | 20 | ||||
-rw-r--r-- | vcl/unx/source/window/salobj.cxx | 2 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 9 |
20 files changed, 121 insertions, 22 deletions
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index e6e78656eedd..708207881fe4 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -294,7 +294,8 @@ css::awt::KeyEvent AcceleratorExecute::st_VCLKey2AWTKey(const KeyCode& aVCLKey) aAWTKey.Modifiers |= css::awt::KeyModifier::MOD1; if (aVCLKey.IsMod2()) aAWTKey.Modifiers |= css::awt::KeyModifier::MOD2; - + if (aVCLKey.IsMod3()) + aAWTKey.Modifiers |= css::awt::KeyModifier::MOD3; return aAWTKey; } @@ -304,9 +305,10 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey) sal_Bool bShift = ((aAWTKey.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT ); sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 ); sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 ); + sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 ); USHORT nKey = (USHORT)aAWTKey.KeyCode; - return KeyCode(nKey, bShift, bMod1, bMod2); + return KeyCode(nKey, bShift, bMod1, bMod2, bMod3); } //----------------------------------------------- ::rtl::OUString AcceleratorExecute::findCommand(const css::awt::KeyEvent& aKey) diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index febb6523e2cc..c8e5e1bd3853 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -682,6 +682,8 @@ namespace aAWTKey.Modifiers |= css::awt::KeyModifier::MOD1; if (aVCLKey.IsMod2()) aAWTKey.Modifiers |= css::awt::KeyModifier::MOD2; + if (aVCLKey.IsMod3()) + aAWTKey.Modifiers |= css::awt::KeyModifier::MOD3; return aAWTKey; } @@ -691,9 +693,10 @@ namespace sal_Bool bShift = ((aAWTKey.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT ); sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 ); sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 ); + sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 ); USHORT nKey = (USHORT)aAWTKey.KeyCode; - return KeyCode(nKey, bShift, bMod1, bMod2); + return KeyCode(nKey, bShift, bMod1, bMod2, bMod3); } } // END ANONYMOUS NAMESPACE diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 8cb7ed60f2a4..b6d0ce5ff916 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1608,7 +1608,9 @@ long VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent, | (pKeyEvent->GetKeyCode().IsMod1() ? ::css::awt::KeyModifier::MOD1 : 0) | (pKeyEvent->GetKeyCode().IsMod2() - ? ::css::awt::KeyModifier::MOD2 : 0), + ? ::css::awt::KeyModifier::MOD2 : 0) + | (pKeyEvent->GetKeyCode().IsMod3() + ? ::css::awt::KeyModifier::MOD3 : 0), pKeyEvent->GetKeyCode().GetCode(), pKeyEvent->GetCharCode(), sal::static_int_cast< sal_Int16 >( pKeyEvent->GetKeyCode().GetFunction())); diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index c767458f03ae..09e318800184 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -548,6 +548,8 @@ void ImplInitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent, const KeyEvent& rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1; if ( rEvt.GetKeyCode().IsMod2() ) rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2; + if ( rEvt.GetKeyCode().IsMod3() ) + rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3; rEvent.KeyCode = rEvt.GetKeyCode().GetCode(); rEvent.KeyChar = rEvt.GetCharCode(); diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index 9e933c7410b6..4ad5e7ff9271 100755 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -86,7 +86,25 @@ return; } } - + + /* + * #i98949# - Cmd-M miniaturize window, Cmd-Option-M miniaturize all windows + */ + if( [[pEvent charactersIgnoringModifiers] isEqualToString: @"m"] ) + { + if ( nModMask == NSCommandKeyMask && ([pFrame->getWindow() styleMask] & NSMiniaturizableWindowMask) ) + { + [pFrame->getWindow() performMiniaturize: nil]; + return; + } + + if ( nModMask == ( NSCommandKeyMask | NSAlternateKeyMask ) ) + { + [NSApp miniaturizeAll: nil]; + return; + } + } + /* #i89611# Cmd-Option-Space is for some reason not consumed by the menubar, but also not by the input method (like e.g. Cmd-Space) and stays diff --git a/vcl/inc/vcl/accel.h b/vcl/inc/vcl/accel.h index 6d1ffd0c28ce..b63adeae9a37 100644 --- a/vcl/inc/vcl/accel.h +++ b/vcl/inc/vcl/accel.h @@ -57,6 +57,6 @@ public: // ----------------- // in KEYCOD.CXX -void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3 ); +void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 ); #endif // _SV_ACCEL_H diff --git a/vcl/inc/vcl/cmdevt.hxx b/vcl/inc/vcl/cmdevt.hxx index fde8fe83b6f2..ac9f852cd54c 100644 --- a/vcl/inc/vcl/cmdevt.hxx +++ b/vcl/inc/vcl/cmdevt.hxx @@ -280,14 +280,17 @@ public: BOOL IsShift() const { return (mnCode & MODKEY_SHIFT) ? TRUE : FALSE; } BOOL IsMod1() const { return (mnCode & MODKEY_MOD1) ? TRUE : FALSE; } BOOL IsMod2() const { return (mnCode & MODKEY_MOD2) ? TRUE : FALSE; } + BOOL IsMod3() const { return (mnCode & MODKEY_MOD3) ? TRUE : FALSE; } BOOL IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? TRUE : FALSE; } BOOL IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? TRUE : FALSE; } BOOL IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? TRUE : FALSE; } + BOOL IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? TRUE : FALSE; } BOOL IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? TRUE : FALSE; } BOOL IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? TRUE : FALSE; } BOOL IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? TRUE : FALSE; } + BOOL IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? TRUE : FALSE; } }; inline CommandModKeyData::CommandModKeyData() diff --git a/vcl/inc/vcl/event.hxx b/vcl/inc/vcl/event.hxx index 20ad3aaaf608..04ba5f7a0abf 100644 --- a/vcl/inc/vcl/event.hxx +++ b/vcl/inc/vcl/event.hxx @@ -176,6 +176,8 @@ public: { return ((mnCode & KEY_MOD1) != 0); } BOOL IsMod2() const { return ((mnCode & KEY_MOD2) != 0); } + BOOL IsMod3() const + { return ((mnCode & KEY_MOD3) != 0); } }; inline MouseEvent::MouseEvent() diff --git a/vcl/inc/vcl/keycod.hxx b/vcl/inc/vcl/keycod.hxx index 6c652a0e5307..cdd1ed35d80f 100644 --- a/vcl/inc/vcl/keycod.hxx +++ b/vcl/inc/vcl/keycod.hxx @@ -73,7 +73,7 @@ public: KeyCode( const ResId& rResId ); KeyCode( USHORT nKey, USHORT nModifier = 0 ) { nCode = nKey | nModifier; eFunc = KEYFUNC_DONTKNOW; } - KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 ); + KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 ); KeyCode( KeyFuncType eFunction ); USHORT GetFullCode() const { return nCode; } @@ -112,7 +112,7 @@ public: BOOL operator !=( const KeyCode& rKeyCode ) const; }; -inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 ) +inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 ) { nCode = nKey; if( bShift ) @@ -121,6 +121,8 @@ inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 ) nCode |= KEY_MOD1; if( bMod2 ) nCode |= KEY_MOD2; + if( bMod3 ) + nCode |= KEY_MOD3; eFunc = KEYFUNC_DONTKNOW; } diff --git a/vcl/inc/vcl/keycodes.hxx b/vcl/inc/vcl/keycodes.hxx index d90e9923f0ad..66d8a87e27a2 100644 --- a/vcl/inc/vcl/keycodes.hxx +++ b/vcl/inc/vcl/keycodes.hxx @@ -176,9 +176,12 @@ #define MODKEY_RMOD1 0x0008 #define MODKEY_LMOD2 0x0010 #define MODKEY_RMOD2 0x0020 +#define MODKEY_LMOD3 0x0040 +#define MODKEY_RMOD3 0x0080 #define MODKEY_SHIFT (MODKEY_LSHIFT|MODKEY_RSHIFT) #define MODKEY_MOD1 (MODKEY_LMOD1|MODKEY_RMOD1) #define MODKEY_MOD2 (MODKEY_LMOD2|MODKEY_RMOD2) +#define MODKEY_MOD3 (MODKEY_LMOD3|MODKEY_RMOD3) // --------------- // - Mouse-Types - diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 3834e4de8677..5f41a441c6a1 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2903,8 +2903,8 @@ PopupMenu* Edit::CreatePopupMenu() pPopup->SetAccelKey( SV_MENU_EDIT_COPY, KeyCode( KEYFUNC_COPY ) ); pPopup->SetAccelKey( SV_MENU_EDIT_PASTE, KeyCode( KEYFUNC_PASTE ) ); pPopup->SetAccelKey( SV_MENU_EDIT_DELETE, KeyCode( KEYFUNC_DELETE ) ); - pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, FALSE, TRUE, FALSE ) ); - pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, TRUE, TRUE, FALSE ) ); + pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, FALSE, TRUE, FALSE, FALSE ) ); + pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, TRUE, TRUE, FALSE, FALSE ) ); return pPopup; } diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 7dfc70c0fe32..34e831d2daf8 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -231,7 +231,8 @@ void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode, USHORT nCode1; USHORT nCode2; USHORT nCode3; - ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3 ); + USHORT nCode4; + ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 ); if ( nCode1 ) ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel ); if ( nCode2 ) diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 1e9a3350c88e..392c2ceaa478 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -1166,7 +1166,7 @@ KeyEvent Window::GetActivationKey() const nCode = KEY_A + (nAccel-'A'); else if( nAccel >= '0' && nAccel <= '9' ) nCode = KEY_0 + (nAccel-'0'); - KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE ); + KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE, FALSE ); aKeyEvent = KeyEvent( nAccel, aKeyCode ); } return aKeyEvent; diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx index 042eac37aa41..77af28241cb3 100644 --- a/vcl/source/window/keycod.cxx +++ b/vcl/source/window/keycod.cxx @@ -74,13 +74,14 @@ static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*3] = // ----------------------------------------------------------------------- -void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3 ) +void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 ) { USHORT nIndex = (USHORT)eFunc; - nIndex *= 3; + nIndex *= 4; rCode1 = aImplKeyFuncTab[nIndex]; rCode2 = aImplKeyFuncTab[nIndex+1]; rCode3 = aImplKeyFuncTab[nIndex+2]; + rCode4 = aImplKeyFuncTab[nIndex+3]; } // ======================================================================= @@ -88,7 +89,7 @@ void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& KeyCode::KeyCode( KeyFuncType eFunction ) { USHORT nDummy; - ImplGetKeyCode( eFunction, nCode, nDummy, nDummy ); + ImplGetKeyCode( eFunction, nCode, nDummy, nDummy, nDummy ); eFunc = eFunction; } @@ -111,7 +112,7 @@ KeyCode::KeyCode( const ResId& rResId ) if ( eFunc != KEYFUNC_DONTKNOW ) { USHORT nDummy; - ImplGetKeyCode( eFunc, nCode, nDummy, nDummy ); + ImplGetKeyCode( eFunc, nCode, nDummy, nDummy, nDummy ); } else nCode = sal::static_int_cast<USHORT>(nKeyCode | nModifier); @@ -151,8 +152,9 @@ KeyFuncType KeyCode::GetFunction() const USHORT nKeyCode1; USHORT nKeyCode2; USHORT nKeyCode3; - ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3 ); - if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) ) + USHORT nKeyCode4; + ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3, nKeyCode4 ); + if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) || (nCompCode == nKeyCode4) ) return (KeyFuncType)i; } } diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx index e3a92194040f..e8474c6efa5d 100644 --- a/vcl/source/window/keyevent.cxx +++ b/vcl/source/window/keyevent.cxx @@ -49,7 +49,8 @@ KeyEvent::KeyEvent( const ::com::sun::star::awt::KeyEvent& rEvent ) rEvent.KeyCode, (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::SHIFT) != 0, (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD1) != 0, - (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 ); + (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0, + (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0); mnRepeat = 0; mnCharCode = rEvent.KeyChar; } @@ -64,6 +65,8 @@ void KeyEvent::InitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent ) const rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1; if( GetKeyCode().IsMod2() ) rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2; + if( GetKeyCode().IsMod3() ) + rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3; rEvent.KeyCode = GetKeyCode().GetCode(); rEvent.KeyChar = GetCharCode(); diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx index 90ca259cc425..a95b90f5e1d0 100644 --- a/vcl/source/window/mouseevent.cxx +++ b/vcl/source/window/mouseevent.cxx @@ -52,6 +52,8 @@ MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent ) mnCode |= KEY_MOD1; if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 ) mnCode |= KEY_MOD2; + if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0 ) + mnCode |= KEY_MOD3; } if( rEvent.Buttons ) @@ -75,6 +77,8 @@ void MouseEvent::InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent ) con rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1; if ( IsMod2() ) rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2; + if ( IsMod3() ) + rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3; rEvent.Buttons = 0; if ( IsLeft() ) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 8aef97904769..e30c36650aa4 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -75,6 +75,13 @@ #define GSS_DBUS_INTERFACE "org.gnome.ScreenSaver" #endif +// make compile on gtk older than 2.10 +#if GTK_MINOR_VERSION < 10 +#define GDK_SUPER_MASK (1 << 26) +#define GDK_HYPER_MASK (1 << 27) +#define GDK_META_MASK (1 << 28) +#endif + using namespace com::sun::star; int GtkSalFrame::m_nFloats = 0; @@ -88,6 +95,11 @@ static USHORT GetKeyModCode( guint state ) nCode |= KEY_MOD1; if( (state & GDK_MOD1_MASK) ) nCode |= KEY_MOD2; + + // Map Meta/Super keys to MOD3 modifier on all Unix systems + // except Mac OS X + if ( (state & GDK_META_MASK ) || ( state & GDK_SUPER_MASK ) ) + nCode |= KEY_MOD3; return nCode; } @@ -2938,7 +2950,8 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame if( pEvent->keyval == GDK_Shift_L || pEvent->keyval == GDK_Shift_R || pEvent->keyval == GDK_Control_L || pEvent->keyval == GDK_Control_R || pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R || - pEvent->keyval == GDK_Meta_L || pEvent->keyval == GDK_Meta_R ) + pEvent->keyval == GDK_Meta_L || pEvent->keyval == GDK_Meta_R || + pEvent->keyval == GDK_Super_L || pEvent->keyval == GDK_Super_R ) { SalKeyModEvent aModEvt; @@ -2987,6 +3000,18 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame nExtModMask = MODKEY_RSHIFT; nModMask = KEY_SHIFT; break; + // Map Meta/Super to MOD3 modifier on all Unix systems + // except Mac OS X + case GDK_Meta_L: + case GDK_Super_L: + nExtModMask = MODKEY_LMOD3; + nModMask = KEY_MOD3; + break; + case GDK_Meta_R: + case GDK_Super_R: + nExtModMask = MODKEY_RMOD3; + nModMask = KEY_MOD3; + break; } if( pEvent->type == GDK_KEY_RELEASE ) { diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 8f2bccebc443..4f66bd3d5291 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -2799,6 +2799,11 @@ static USHORT sal_GetCode( int state ) if( state & Mod1Mask ) nCode |= KEY_MOD2; + // Map Meta/Super modifier to MOD3 on all Unix systems + // except Mac OS X + if( (state & Mod3Mask) ) + nCode |= KEY_MOD3; + return nCode; } @@ -3167,7 +3172,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R || nKeySym == XK_Control_L || nKeySym == XK_Control_R || nKeySym == XK_Alt_L || nKeySym == XK_Alt_R - || nKeySym == XK_Meta_L || nKeySym == XK_Meta_R ) + || nKeySym == XK_Meta_L || nKeySym == XK_Meta_R + || nKeySym == XK_Super_L || nKeySym == XK_Super_R ) { SalKeyModEvent aModEvt; aModEvt.mnModKeyCode = 0; @@ -3211,6 +3217,18 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) nExtModMask = MODKEY_RSHIFT; nModMask = KEY_SHIFT; break; + // Map Meta/Super keys to MOD3 modifier on all Unix systems + // except Mac OS X + case XK_Meta_L: + case XK_Super_L: + nExtModMask = MODKEY_LMOD3; + nModMask = KEY_MOD3; + break; + case XK_Meta_R: + case XK_Super_R: + nExtModMask = MODKEY_RMOD3; + nModMask = KEY_MOD3; + break; } if( pEvent->type == KeyRelease ) { diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx index fd3a12ed2d34..49b1a677c98b 100644 --- a/vcl/unx/source/window/salobj.cxx +++ b/vcl/unx/source/window/salobj.cxx @@ -474,6 +474,8 @@ static USHORT sal_GetCode( int state ) nCode |= KEY_MOD1; if( state & Mod1Mask ) nCode |= KEY_MOD2; + if( state & Mod3Mask ) + nCode |= KEY_MOD3; return nCode; } diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index fd0f065ce2bc..140e506686fc 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -3703,10 +3703,17 @@ BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangT BYTE vkeycode = LOBYTE(scan); BYTE shiftstate = HIBYTE(scan); + // Last argument is set to FALSE, because there's no decission made + // yet which key should be assigned to MOD3 modifier on Windows. + // Windows key - user's can be confused, because it should display + // Windows menu (applies to both left/right key) + // Menu key - this key is used to display context menu + // AltGr key - probably it has no sense rKeyCode = KeyCode( ImplSalGetKeyCode( vkeycode ), (shiftstate & 0x01) ? TRUE : FALSE, // shift (shiftstate & 0x02) ? TRUE : FALSE, // ctrl - (shiftstate & 0x04) ? TRUE : FALSE ); // alt + (shiftstate & 0x04) ? TRUE : FALSE, // alt + FALSE ); bRet = TRUE; } } |