fix bug 7614. call the xterm keysym2ucs function to convert keysym which

XmbLookupString do not understand to unicode. r=pavlov
This commit is contained in:
ftang%netscape.com 2000-01-13 05:20:51 +00:00
parent bc209b8ee8
commit 3df7c0b3ac
2 changed files with 16 additions and 2 deletions

View File

@ -26,6 +26,9 @@ LIBRARY_NAME = widget_gtk
REQUIRES = util img xpcom raptor netlib
CSRCS = \
keysym2ucs.c
CPPSRCS = \
nsAppShell.cpp \
nsButton.cpp \

View File

@ -21,6 +21,7 @@
*/
#include "nsWidget.h"
#include "keysym2ucs.h"
#include "nsWindow.h"
#include "nsScrollbar.h"
@ -361,10 +362,20 @@ void InitKeyPressEvent(GdkEventKey *aGEK,
// XXX
anEvent.isMeta = PR_FALSE; //(aGEK->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;
if(aGEK->length)
if(aGEK->length) {
anEvent.charCode = nsConvertCharCodeToUnicode(aGEK);
else
} 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;