fix the problem taht PageUp/PageDown/Up/Down/Left/Right/Home/End does not work after we land the keyevent branch. add missing isMeta code there

This commit is contained in:
ftang%netscape.com 1999-10-14 20:03:00 +00:00
Родитель bd9000ea54
Коммит bb8634c69c
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -300,6 +300,7 @@ void InitKeyEvent(GdkEventKey *aGEK,
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.point.x = 0;
anEvent.point.y = 0;
}
@ -323,7 +324,10 @@ void InitKeyPressEvent(GdkEventKey *aGEK,
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(aGEK->length)
anEvent.charCode = nsConvertCharCodeToUnicode(aGEK);
else
anEvent.charCode = 0;
if (anEvent.charCode)
anEvent.keyCode = 0;
@ -595,6 +599,7 @@ static gint composition_draw(GdkEventKey *aEvent, nsWindow *aWin,
textEvent.isShift = (aEvent->state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;
textEvent.isControl = (aEvent->state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;
textEvent.isAlt = (aEvent->state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;
textEvent.isMeta = (aEvent->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;
textEvent.eventStructType = NS_TEXT_EVENT;
aWin->DispatchEvent(&textEvent, *aStatus);
@ -757,6 +762,9 @@ gint handle_key_press_event(GtkWidget *w, GdkEventKey* event, gpointer p)
InitKeyPressEvent(event,p, kevent);
win->OnKey(kevent);
}
} else { // for Home/End/Up/Down/Left/Right/PageUp/PageDown key
InitKeyPressEvent(event,p, kevent);
win->OnKey(kevent);
}
#else
if (event->length) {