Index: libx11-1.1.4/modules/im/ximcp/imThaiFlt.c =================================================================== --- libx11-1.1.4.orig/modules/im/ximcp/imThaiFlt.c 2008-07-14 18:13:20.000000000 +0700 +++ libx11-1.1.4/modules/im/ximcp/imThaiFlt.c 2008-07-14 19:00:10.000000000 +0700 @@ -1236,6 +1236,22 @@ return True; } +Private unsigned +NumLockMask(Display *d) +{ + int i; + XModifierKeymap *map = XGetModifierMapping (d); + KeyCode numlock_keycode = XKeysymToKeycode (d, XK_Num_Lock); + if (numlock_keycode == NoSymbol) + return 0; + + for (i = 0; i < 8; i++) { + if (map->modifiermap[map->max_keypermod * i] == numlock_keycode) + return 1 << i; + } + return 0; +} + /* * Filter function for TACTIS */ @@ -1271,7 +1287,7 @@ XwcLookupString((XIC)ic, &ev->xkey, wbuf, sizeof(wbuf) / sizeof(wbuf[0]), &symbol, NULL); - if ((ev->xkey.state & (AllMods & ~ShiftMask)) || + if ((ev->xkey.state & (AllMods & ~(ShiftMask|LockMask|NumLockMask(d)))) || ((symbol >> 8 == 0xFF) && ((XK_BackSpace <= symbol && symbol <= XK_Clear) || (symbol == XK_Return) ||