+ if ( converted )
+ {
+ UInt32 keyCode ;
+ unsigned char charCode ;
+ UInt32 modifiers ;
+#ifndef __LP64__
+ GetMouse( &rec->where) ;
+#endif
+ err = GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
+ err = GetEventParameter(event, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
+ err = GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode);
+ rec->modifiers = modifiers ;
+ rec->message = (keyCode << 8 ) + charCode ;
+ }
+ }
+ break ;
+
+ case kEventClassTextInput :
+ {
+ switch ( GetEventKind( event ) )
+ {
+ case kEventTextInputUnicodeForKeyEvent :
+ {
+ EventRef rawEvent ;
+ err = GetEventParameter(
+ event, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL,
+ sizeof(rawEvent), NULL, &rawEvent ) ;
+ converted = true ;
+
+ {
+ UInt32 keyCode, modifiers;
+ unsigned char charCode ;
+#ifndef __LP64__
+
+ GetMouse( &rec->where) ;
+#endif
+ rec->what = keyDown ;
+ err = GetEventParameter(rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
+ err = GetEventParameter(rawEvent, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
+ err = GetEventParameter(rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode);
+ rec->modifiers = modifiers ;
+ rec->message = (keyCode << 8 ) + charCode ;
+ }
+ }
+ break ;
+
+ default :
+ break ;
+ }
+ }
+ break ;