зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
bd9000ea54
Коммит
bb8634c69c
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче