printf("Key Press event: gtk string = '%s', keyCode = 0x%x, char code = '%c'", aGEK->string, anEvent.keyCode, anEvent.charCode);
printf("Key Press event: gtk string = '%s', keyval = '%c',\n", aGEK->string, aGEK->keyval); printf("    --> keyCode = 0x%x, char code = '%c'", anEvent.keyCode, anEvent.charCode);
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;    // XXX    anEvent.isMeta = PR_FALSE; //(aGEK->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;    if(aGEK->length) {       anEvent.charCode = nsConvertCharCodeToUnicode(aGEK);    } else  {       anEvent.charCode = 0;       // now, let's handle some keysym which XmbLookupString didn't handle       // because they are not part of the locale encoding       if( (aGEK->keyval >= 0xa0 && (aGEK->keyval <= 0xf000) ||           (aGEK->keyval & 0xff000000U) == 0x01000000))       {          long ucs = keysym2ucs(aGEK->keyval);          if( (-1 != ucs ) && ( ucs < 0x10000))             anEvent.charCode = ucs;       }    }    if (anEvent.charCode) {      anEvent.keyCode = 0;            // if the control, meta, or alt key is down, then we should leave      // the isShift flag alone (probably not a printable character)      // if none of the other modifier keys are pressed then we need to      // clear isShift so the character can be inserted in the editor      if (!anEvent.isControl && !anEvent.isAlt && !anEvent.isMeta)        anEvent.isShift = PR_FALSE;    } else      anEvent.keyCode = nsPlatformToDOMKeyCode(aGEK);#if defined(DEBUG_akkana_not) || defined (DEBUG_ftang)    printf("Key Press event: gtk string = '%s', keyCode = 0x%x, char code = '%c'",           aGEK->string, 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;  }}