anEvent.charCode = nsConvertCharCodeToUnicode(aGEK);
if(aGEK->length) anEvent.charCode = nsConvertCharCodeToUnicode(aGEK); else anEvent.charCode = 0;
void InitKeyPressEvent(GdkEventKey *aGEK,                       gpointer p,                       nsKeyEvent &anEvent){  //  // init the basic event fields  //  anEvent.eventStructType = NS_KEY_EVENT;  anEvent.message = NS_KEY_PRESS;  anEvent.widget = (nsWidget*)p;  if (aGEK!=nsnull)  {    anEvent.isShift = (aGEK->state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;    anEvent.isControl = (aGEK->state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;    anEvent.isAlt = (aGEK->state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;    anEvent.isMeta = (aGEK->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;    anEvent.charCode = nsConvertCharCodeToUnicode(aGEK);    if (anEvent.charCode)      anEvent.keyCode = 0;    else      anEvent.keyCode = nsPlatformToDOMKeyCode(aGEK);#if defined(DEBUG_akkana) || defined(DEBUG_pavlov)    printf("Key Press event: keyCode = %d, char code = '%c'",           anEvent.keyCode, anEvent.charCode);    if (anEvent.isShift)      printf(" [shift]");    if (anEvent.isControl)      printf(" [ctrl]");    if (anEvent.isAlt)      printf(" [alt]");    if (anEvent.isMeta)      printf(" [meta]");    printf("\n");#endif    anEvent.time = aGEK->time;    anEvent.point.x = 0;    anEvent.point.y = 0;  }}