diff -urN ooo_SRC680_m180_src.orig/vcl/aqua/source/window/salframe.cxx ooo_SRC680_m180_src/vcl/aqua/source/window/salframe.cxx
--- ooo_SRC680_m180_src.orig/vcl/aqua/source/window/salframe.cxx	2006-08-02 18:41:06.000000000 +0200
+++ ooo_SRC680_m180_src/vcl/aqua/source/window/salframe.cxx	2006-08-02 22:50:28.000000000 +0200
@@ -1312,75 +1312,110 @@
 
 OSStatus HandleKeyboardEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
 {
-  UInt32 keyModifiers;
-
-  ImplSalYieldMutexAcquire();
-
-  AquaSalFrame* pSalFrame = reinterpret_cast<AquaSalFrame*>(inUserData);
-
-  fprintf(stderr, "PJ: HandleKeyboardEvent\n");
-
-  UInt32 eventKind = GetEventKind(inEvent);
-
-  switch (eventKind) {
-  case kEventRawKeyUp:
-  case kEventRawKeyDown:
-  case kEventRawKeyRepeat:
-
-    if (eventKind == kEventRawKeyDown)
-      fprintf(stderr, "PJ: ... kEventRawKeyDown\n");
-    else if (eventKind == kEventRawKeyUp)
-      fprintf(stderr, "PJ: ... kEventRawKeyUp\n");
-    else if (eventKind == kEventRawKeyRepeat)
-      fprintf(stderr, "PJ: ... kEventRawKeyRepeat\n");
-
-    UInt32 keyCode, keyboardType;
-    char keyChar;
-
-    GetEventParameter (inEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(keyCode), NULL, &keyCode);
-    fprintf(stderr, "PJ: ...... keyCode = %d (%x)\n", keyCode, keyCode);
-
-    GetEventParameter (inEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(keyChar), NULL, &keyChar);
-    fprintf(stderr, "PJ: ...... keyChar = %c\n", keyChar);
-
-    GetEventParameter (inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(keyModifiers), NULL, &keyModifiers);
-    fprintf(stderr, "PJ: ...... keyModifiers = %d (%x)\n", keyModifiers, keyModifiers);
+    static ULONG nRepeatCount = 0;
+    UInt32 keyModifiers;
+    USHORT nModCode = 0;
+
+    ImplSalYieldMutexAcquire();
+
+    AquaSalFrame* pSalFrame = reinterpret_cast<AquaSalFrame*>(inUserData);
+
+    fprintf(stderr, "PJ: HandleKeyboardEvent\n");
+
+    UInt32 eventKind = GetEventKind(inEvent);
+
+    switch (eventKind) {
+    case kEventRawKeyUp:
+    case kEventRawKeyDown:
+    case kEventRawKeyRepeat:
+
+        if (eventKind == kEventRawKeyDown)
+            fprintf(stderr, "PJ: ... kEventRawKeyDown\n");
+        else if (eventKind == kEventRawKeyUp)
+            fprintf(stderr, "PJ: ... kEventRawKeyUp\n");
+        else if (eventKind == kEventRawKeyRepeat)
+            fprintf(stderr, "PJ: ... kEventRawKeyRepeat\n");
+
+        UInt32 keyCode, keyboardType;
+        char keyChar;
+
+        GetEventParameter (inEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(keyCode), NULL, &keyCode);
+        fprintf(stderr, "PJ: ...... keyCode = %d (%x)\n", keyCode, keyCode);
+
+        GetEventParameter (inEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(keyChar), NULL, &keyChar);
+        fprintf(stderr, "PJ: ...... keyChar = %c (%x)\n", keyChar, keyChar);
+
+        GetEventParameter (inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(keyModifiers), NULL, &keyModifiers);
+        fprintf(stderr, "PJ: ...... keyModifiers = %d (%x)\n", keyModifiers, keyModifiers);
+
+        DbgPrintModifiers(keyModifiers);
+
+        GetEventParameter (inEvent, kEventParamKeyboardType, typeUInt32, NULL, sizeof(keyboardType), NULL, &keyboardType);
+        fprintf(stderr, "PJ: ...... keyboardType = %d (%x)\n", keyboardType, keyboardType);
+
+        SalKeyEvent aKeyEvt;
+
+        if ( (keyChar >= '0') && (keyChar <= '9') )
+            aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_NUM + keyChar - '0');
+        else if ( (keyChar >= 'A') && (keyChar <= 'Z') )
+            aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + keyChar - 'A');
+        else if ( (keyChar >= 'a') && (keyChar <= 'z') )
+            aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + keyChar - 'a');
+        else if ( keyChar == 0x0d )    // RETURN
+            aKeyEvt.mnCode = KEY_RETURN;
+        else if ( keyChar == 0x1b )    // ESCAPE
+            aKeyEvt.mnCode = KEY_ESCAPE;
+        else if ( keyChar == 0x09 )    // TAB
+            aKeyEvt.mnCode = KEY_TAB;
+        else if ( keyChar == 0x20 )    // SPACE
+            aKeyEvt.mnCode = KEY_SPACE;
+        else
+            aKeyEvt.mnCode = aImplTranslateKeyTab[keyCode];
 
-    DbgPrintModifiers(keyModifiers);
+        aKeyEvt.mnCharCode = keyChar;
 
-    GetEventParameter (inEvent, kEventParamKeyboardType, typeUInt32, NULL, sizeof(keyboardType), NULL, &keyboardType);
-    fprintf(stderr, "PJ: ...... keyboardType = %d (%x)\n", keyboardType, keyboardType);
+        // Set modifiers
+        // FIXME: how to map them? shift, option, control and command!
+        if (keyModifiers & shiftKey)
+            nModCode |= KEY_SHIFT;
+        if (keyModifiers & controlKey)
+            nModCode |= KEY_MOD1;
+        if (keyModifiers & optionKey)
+            nModCode |= KEY_MOD2;
 
-    SalKeyEvent aKeyEvt;
+        aKeyEvt.mnCode |= nModCode;
+        aKeyEvt.mnTime = static_cast<ULONG>(GetEventTime(inEvent) * 1000);
 
-    // FIXME: proper mapping of *all* keys? Where, how? Study Windows code first.
-    aKeyEvt.mnCode = aImplTranslateKeyTab[keyCode];
+        if (eventKind == kEventRawKeyRepeat)
+            aKeyEvt.mnRepeat = nRepeatCount++;
+        else
+            // Not repeat event -> reset repeat counter
+            nRepeatCount = 0;
 
-    aKeyEvt.mnTime = static_cast<ULONG>(GetEventTime(inEvent) * 1000);
+        if (eventKind == kEventRawKeyDown || eventKind == kEventRawKeyRepeat)
+            pSalFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
+        if (eventKind == kEventRawKeyUp)
+            pSalFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
 
-    // Is this correct? Why not SALEVENT_KEYDOWN?
-    if (eventKind == kEventRawKeyDown)
-      pSalFrame->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
-    if (eventKind == kEventRawKeyUp)
-      pSalFrame->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
+        break;
 
-    break;
+    case kEventRawKeyModifiersChanged:
+        fprintf(stderr, "PJ: ... kEventRawKeyModifiersChanged\n");
 
-  case kEventRawKeyModifiersChanged:
-    fprintf(stderr, "PJ: ... kEventRawKeyModifiersChanged\n");
+        GetEventParameter (inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(keyModifiers), NULL, &keyModifiers);
+        fprintf(stderr, "PJ: ...... keyModifiers = %d (%x)\n", keyModifiers, keyModifiers);
 
-    GetEventParameter (inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(keyModifiers), NULL, &keyModifiers);
-    fprintf(stderr, "PJ: ...... keyModifiers = %d (%x)\n", keyModifiers, keyModifiers);
+        DbgPrintModifiers(keyModifiers);
 
-    DbgPrintModifiers(keyModifiers);
+        // FIXME: send KEYMODCHANGE event...
 
-    break;
+        break;
 
-  default:
-    fprintf(stderr, "PJ: ... UNKNOWN!!!\n");
-  }
+    default:
+        fprintf(stderr, "PJ: ... UNKNOWN!!!\n");
+    }
 
-  ImplSalYieldMutexRelease();
+    ImplSalYieldMutexRelease();
 
   return noErr;
 }
