Index: inc/cmdevt.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/cmdevt.hxx,v
retrieving revision 1.16
retrieving revision 1.16.22.1
diff -u -r1.16 -r1.16.22.1
--- inc/cmdevt.hxx	19 Jun 2006 19:01:44 -0000	1.16
+++ inc/cmdevt.hxx	2 Jul 2006 16:16:02 -0000	1.16.22.1
@@ -181,6 +181,10 @@
                         { return ((mnCode & KEY_MOD1) != 0); }
     BOOL            IsMod2() const
                         { return ((mnCode & KEY_MOD2) != 0); }
+#ifdef MACOSX
+    BOOL	    IsMod5() const
+			{ return ((mnCode & KEY_MOD5) != 0); }
+#endif
 };
 
 inline CommandWheelData::CommandWheelData()
Index: inc/keycod.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/keycod.hxx,v
retrieving revision 1.5
retrieving revision 1.5.306.1
diff -u -r1.5 -r1.5.306.1
--- inc/keycod.hxx	9 Sep 2005 11:07:03 -0000	1.5
+++ inc/keycod.hxx	2 Jul 2006 16:16:02 -0000	1.5.306.1
@@ -95,7 +95,11 @@
 				KeyCode( KeyFuncType eFunction );
 
 	USHORT		GetFullCode() const { return nCode; }
+#ifdef MACOSX
+	USHORT		GetFullKeyCode() const { return (nCode) ; }
+#else
 	USHORT		GetFullKeyCode() const { return (nCode & ~KEY_CONTROLMOD); }
+#endif
 	KeyFuncType GetFullFunction() const { return eFunc; }
 	BOOL		IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
 
@@ -112,9 +116,16 @@
 					{ return ((nCode & KEY_MOD1) != 0); }
 	BOOL		IsMod2() const
 					{ return ((nCode & KEY_MOD2) != 0); }
+#ifdef MACOSX
+	//  [ericb 07/2006]] Remap ALT with mod5, working fine with Tiger
+	BOOL		IsMod5() const
+					{ return ((nCode & KEY_MOD5) != 0); }	
+	BOOL		IsControlMod() const
+					{ return (IsMod2() && IsMod1() && IsMod5()); }
+#else
 	BOOL		IsControlMod() const
 					{ return ((nCode & KEY_CONTROLMOD) != 0); }
-
+#endif
 	USHORT		GetGroup() const
 					{ return (nCode & KEYGROUP_TYPE); }
 
Index: inc/keycodes.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/keycodes.hxx,v
retrieving revision 1.7
retrieving revision 1.7.208.1
diff -u -r1.7 -r1.7.208.1
--- inc/keycodes.hxx	20 Jan 2006 12:52:10 -0000	1.7
+++ inc/keycodes.hxx	2 Jul 2006 16:16:03 -0000	1.7.208.1
@@ -170,8 +170,13 @@
 #define KEY_SHIFT		((USHORT)0x1000)
 #define KEY_MOD1		((USHORT)0x2000)
 #define KEY_MOD2		((USHORT)0x4000)
+#ifdef MACOSX
+#define KEY_MOD5	((USHORT)0x8000)
+#define KEY_MODTYPE	((USHORT)0xF000)
+#else
 #define KEY_MODTYPE 	((USHORT)0x7000)
 #define KEY_CONTROLMOD	((USHORT)0x8000)
+#endif
 #define KEY_ALLMODTYPE	((USHORT)0xF000)
 
 // extended Modifier-Keys (only used for modkey events)
Index: source/window/keycod.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/window/keycod.cxx,v
retrieving revision 1.8
retrieving revision 1.8.22.1
diff -u -r1.8 -r1.8.22.1
--- source/window/keycod.cxx	19 Jun 2006 19:38:36 -0000	1.8
+++ source/window/keycod.cxx	2 Jul 2006 16:17:14 -0000	1.8.22.1
@@ -60,7 +60,30 @@
 
 
 // =======================================================================
-
+#ifdef MACOSX
+static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*3] =
+{
+	0, 0, 0,												// KEYFUNC_DONTKNOW
+	KEY_N | KEY_MOD5, 0, 0,									// KEYFUNC_NEW
+	KEY_O | KEY_MOD5, KEY_OPEN, 0,							// KEYFUNC_OPEN
+	KEY_S | KEY_MOD5, 0, 0,									// KEYFUNC_SAVE
+	0, 0, 0,												// KEYFUNC_SAVEAS
+	KEY_P | KEY_MOD5, 0, 0, 								// KEYFUNC_PRINT
+	KEY_W | KEY_MOD5, KEY_F4 | KEY_MOD5, 0, 				// KEYFUNC_CLOSE
+	KEY_Q | KEY_MOD5, KEY_F4 | KEY_MOD2, 0, 				// KEYFUNC_QUIT
+	KEY_X | KEY_MOD5, KEY_DELETE | KEY_SHIFT, KEY_CUT,		// KEYFUNC_CUT
+	KEY_C | KEY_MOD5, KEY_INSERT | KEY_MOD5, KEY_COPY,		// KEYFUNC_COPY
+	KEY_V | KEY_MOD5, KEY_INSERT | KEY_SHIFT, KEY_PASTE,	// KEYFUNC_PASTE
+	KEY_Z | KEY_MOD5, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO,	// KEYFUNC_UNDO
+	0, 0, 0,												// KEYFUNC_REDO
+	KEY_DELETE, 0, 0,										// KEYFUNC_DELETE
+	KEY_REPEAT, 0, 0,										// KEYFUNC_REPEAT
+	KEY_F | KEY_MOD5, KEY_FIND, 0,							// KEYFUNC_FIND
+	KEY_F | KEY_SHIFT | KEY_MOD5, KEY_SHIFT | KEY_FIND, 0,	// KEYFUNC_FINDBACKWARD
+	KEY_RETURN | KEY_MOD2, 0, 0,							// KEYFUNC_PROPERTIES
+	0, 0, 0 												// KEYFUNC_FRONT
+};
+#else
 static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*3] =
 {
 	0, 0, 0,												// KEYFUNC_DONTKNOW
@@ -83,7 +106,7 @@
 	KEY_RETURN | KEY_MOD2, 0, 0,							// KEYFUNC_PROPERTIES
 	0, 0, 0 												// KEYFUNC_FRONT
 };
-
+#endif
 // -----------------------------------------------------------------------
 
 void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3 )
Index: source/window/winproc.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/window/winproc.cxx,v
retrieving revision 1.108
retrieving revision 1.108.22.1
diff -u -r1.108 -r1.108.22.1
--- source/window/winproc.cxx	20 Jun 2006 11:05:58 -0000	1.108
+++ source/window/winproc.cxx	2 Jul 2006 16:17:14 -0000	1.108.22.1
@@ -642,7 +642,11 @@
                                 // create a uno mouse event out of the available data
                                 ::com::sun::star::awt::MouseEvent aMouseEvent(
                                     static_cast < ::com::sun::star::uno::XInterface * > ( 0 ),
+#ifdef MACOSX
+				    nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD5),
+#else
                                     nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2),
+#endif
                                     nCode & (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE),
                                     nMouseX,
                                     nMouseY,
@@ -2089,7 +2093,11 @@
     return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, FALSE,
                                  pEvent->mnX, pEvent->mnY,
                                  pEvent->mnTime,
+#ifdef MACOSX
+				 pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD5)),
+#else
                                  pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)),
+#endif
                                  ImplGetMouseButtonMode( pEvent ) );
 }
 
@@ -2100,7 +2108,11 @@
     return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, FALSE,
                                  pEvent->mnX, pEvent->mnY,
                                  pEvent->mnTime,
+#ifdef MACOSX
+				 pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD5)),
+#else
                                  pEvent->mnButton | (pEvent->mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)),
+#endif
                                  ImplGetMouseButtonMode( pEvent ) );
 }
 
@@ -2159,11 +2171,19 @@
     Window* pTrackWin = pSVData->maWinData.mpTrackWin;
     if ( pTrackWin )
         pWindow = pTrackWin;
+#ifdef MACOSX
+    USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD5);
+#else
     USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
+#endif
     USHORT nNewCode = pEvent->mnCode;
     if ( nOldCode != nNewCode )
     {
+#ifdef MACOSX
+	nNewCode |= pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD5);
+#else
         nNewCode |= pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
+#endif
         pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, TRUE );
     }
 
Index: unx/gtk/window/gtkframe.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/gtk/window/gtkframe.cxx,v
retrieving revision 1.49
retrieving revision 1.49.18.1
diff -u -r1.49 -r1.49.18.1
--- unx/gtk/window/gtkframe.cxx	19 Jun 2006 19:45:29 -0000	1.49
+++ unx/gtk/window/gtkframe.cxx	2 Jul 2006 16:19:28 -0000	1.49.18.1
@@ -85,7 +85,11 @@
 	{
         nCode |= KEY_MOD2;
 		if( ! (nCode & KEY_MOD1) )
+#ifdef MACOSX
+			nCode |= KEY_MOD5;
+#else
 			nCode |= KEY_CONTROLMOD;
+#endif
 	}
     return nCode;
 }
@@ -2329,11 +2333,19 @@
                 break;
             case GDK_Alt_L:
                 nExtModMask = MODKEY_LMOD2;
+#ifdef MACOSX
+		nModMask = KEY_MOD5 | (pEvent->type == GDK_KEY_RELEASE ? KEY_MOD5: 0);
+#else
                 nModMask = KEY_MOD2 | (pEvent->type == GDK_KEY_RELEASE ? KEY_CONTROLMOD : 0);
+#endif
                 break;
             case GDK_Alt_R:
                 nExtModMask = MODKEY_RMOD2;
+#ifdef MACOSX
+		nModMask = KEY_MOD2 | (pEvent->type == GDK_KEY_RELEASE ? KEY_MOD5 : 0);
+#else
                 nModMask = KEY_MOD2 | (pEvent->type == GDK_KEY_RELEASE ? KEY_CONTROLMOD : 0);
+#endif
                 break;
             case GDK_Shift_L:
                 nExtModMask = MODKEY_LSHIFT;
@@ -2364,7 +2376,11 @@
 		{
 			// emulate KEY_MENU
 			if( ( pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R ) &&
+#ifdef MACOSX
+				( nModCode & ~(KEY_MOD5|KEY_MOD2)) == 0 )
+#else
 				( nModCode & ~(KEY_CONTROLMOD|KEY_MOD2)) == 0 )
+#endif
 			{
 				if( pEvent->type == GDK_KEY_PRESS )
 					pThis->m_bSingleAltPress = true;
Index: unx/inc/saldisp.hxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/inc/saldisp.hxx,v
retrieving revision 1.34
retrieving revision 1.34.22.1
diff -u -r1.34 -r1.34.22.1
--- unx/inc/saldisp.hxx	19 Jun 2006 19:46:55 -0000	1.34
+++ unx/inc/saldisp.hxx	2 Jul 2006 16:17:53 -0000	1.34.22.1
@@ -360,6 +360,9 @@
     KeySym			nShiftKeySym_;		// first shift modifier
     KeySym			nCtrlKeySym_;		// first control modifier
     KeySym			nMod1KeySym_;		// first mod1 modifier
+#ifdef MACOSX
+    KeySym			nMod2KeySym_;		//first mod2 modifier
+#endif
     ByteString		m_aKeyboardName;
     
     vcl_sal::WMAdaptor*	m_pWMAdaptor;
Index: unx/source/app/saldisp.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/app/saldisp.cxx,v
retrieving revision 1.74
retrieving revision 1.74.18.1
diff -u -r1.74 -r1.74.18.1
--- unx/source/app/saldisp.cxx	19 Jun 2006 19:51:34 -0000	1.74
+++ unx/source/app/saldisp.cxx	2 Jul 2006 16:18:17 -0000	1.74.18.1
@@ -1226,7 +1226,9 @@
     nShiftKeySym_   = sal_XModifier2Keysym( pDisp_, pXModMap, ShiftMapIndex );
     nCtrlKeySym_    = sal_XModifier2Keysym( pDisp_, pXModMap, ControlMapIndex );
     nMod1KeySym_    = sal_XModifier2Keysym( pDisp_, pXModMap, Mod1MapIndex );
-
+#ifdef MACOSX
+    nMod2KeySym_    = sal_XModifier2Keysym( pDisp_, pXModMap, Mod2MapIndex );
+#endif
     // Auf Sun-Servern und SCO-Severn beruecksichtigt XLookupString
     // nicht den NumLock Modifier.
     if( 	(GetServerVendor() == vendor_sun)
@@ -1253,9 +1255,19 @@
 XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const
 {
     String aStrMap;
-
+#ifdef MACOSX
+    if( nKeyCode & KEY_MOD5 )
+    {
+	aStrMap += GetKeyNameFromKeySym( nMod2KeySym_ );
+    }
+    if( nKeyCode & KEY_MOD2 )
+    {
+	if ( aStrMap.Len() )
+	    aStrMap += '+' ;
+#else
     if( nKeyCode & KEY_MOD2 )
     {
+#endif    
         aStrMap += GetKeyNameFromKeySym( nMod1KeySym_ );
     }
     if( nKeyCode & KEY_MOD1 )
Index: unx/source/window/salframe.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/window/salframe.cxx,v
retrieving revision 1.205
retrieving revision 1.205.20.1
diff -u -r1.205 -r1.205.20.1
--- unx/source/window/salframe.cxx	19 Jun 2006 19:57:36 -0000	1.205
+++ unx/source/window/salframe.cxx	2 Jul 2006 16:18:53 -0000	1.205.20.1
@@ -2775,13 +2775,17 @@
 		nModCode |= KEY_SHIFT;
 	if( pEvent->state & ControlMask )
 		nModCode |= KEY_MOD1;
+#ifdef MACOSX
+	if( pEvent->state & Mod2Mask )
+		nModCode |= KEY_MOD5;
+#else
 	if( pEvent->state & Mod1Mask )
 	{
 		nModCode |= KEY_MOD2;
 		if ( !(nModCode & KEY_MOD1) )
 			nModCode |= KEY_CONTROLMOD;
 	}
-
+#endif
 	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
@@ -2815,11 +2819,19 @@
                 break;
             case XK_Alt_L:
                 nExtModMask = MODKEY_LMOD2;
+#ifdef MACOSX
+		nModMask = KEY_MOD2 | (pEvent->type==KeyRelease ? KEY_MOD5 : 0 );
+#else
                 nModMask = KEY_MOD2 | (pEvent->type==KeyRelease ? KEY_CONTROLMOD : 0);
+#endif
                 break;
             case XK_Alt_R:
                 nExtModMask = MODKEY_RMOD2;
+#ifdef MACOSX
+		nModMask = KEY_MOD2 | (pEvent->type==KeyRelease ? KEY_MOD5 : 0 );
+#else
                 nModMask = KEY_MOD2 | (pEvent->type==KeyRelease ? KEY_CONTROLMOD : 0);
+#endif
                 break;
             case XK_Shift_L:
                 nExtModMask = MODKEY_LSHIFT;
@@ -2848,7 +2860,11 @@
 
         // emulate KEY_MENU
         if ( ( (nKeySym == XK_Alt_L) || (nKeySym == XK_Alt_R) ) &&
+#ifdef MACOSX
+	     ( (nModCode & ~(KEY_MOD5|KEY_MOD2)) == 0 ) )
+#else
              ( (nModCode & ~(KEY_CONTROLMOD|KEY_MOD2)) == 0 ) )
+#endif
         {
             if( pEvent->type == XLIB_KeyPress )
                 mbKeyMenu = true;
