Overview
| Artifact ID: | b2a70d003750d8ba063a8afd568005c4352ac596 |
|---|---|
| Ticket: | 481308ffffffffffffffffffffffffffffffffff |
| Date: | 2001-11-13 21:53:34 |
| User: | tfengler |
| Artifact Attached: | 4e3484a30e28de7dc322bd96de7121beb19e450f |
| Filename: | patch_tkUnixKey.c |
| Description: | patch for tkUnixKey.c and tkInt.h in one File |
Content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67--- tkUnixKey.c.orig Tue Nov 13 15:05:22 2001 +++ tkUnixKey.c Tue Nov 13 14:58:53 2001 @@ -182,14 +182,27 @@ */ index = 0; + if (eventPtr->xkey.state & dispPtr->modeModMask) { index = 2; + } + else if (eventPtr->xkey.state & dispPtr->numlockModMask) { + /* The "Numlockkey" in Sun Solaris has the same effect as the "Mode"-Key + * but only on the keys of the numerals pad + * When the "Numlockkey" is pressed, first get the keysym with index=2, + * then test wether it is a keysym of the numerals pad. If it is not, + * go back to index=0 + */ + index = 2; + sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, index); + if (sym < XK_KP_Multiply || sym > XK_KP_9) + index=0; } if ((eventPtr->xkey.state & ShiftMask) || ((dispPtr->lockUsage != LU_IGNORE) && (eventPtr->xkey.state & LockMask))) { index += 1; - } + } sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, index); /* @@ -287,6 +300,7 @@ dispPtr->modeModMask = 0; dispPtr->metaModMask = 0; dispPtr->altModMask = 0; + dispPtr->numlockModMask = 0; codePtr = modMapPtr->modifiermap; max = 8*modMapPtr->max_keypermod; for (i = 0; i < max; i++, codePtr++) { @@ -303,6 +317,13 @@ if ((keysym == XK_Alt_L) || (keysym == XK_Alt_R)) { dispPtr->altModMask |= ShiftMask << (i/modMapPtr->max_keypermod); } + /* The "Numlockkey" is needed in function TkpGetKeySym to split + * keys from the numerals pad from other keys while the NumLock-Key + * is pressed + */ + if (keysym == XK_Num_Lock) { + dispPtr->numlockModMask |= ShiftMask << (i/modMapPtr->max_keypermod); + } } /* --- tkInt.h.orig Tue Nov 13 15:07:13 2001 +++ tkInt.h Tue Nov 13 15:12:49 2001 @@ -129,6 +129,9 @@ unsigned int altModMask; /* Has one bit set to indicate the modifier * corresponding to the "Meta" key. If no * such modifier, then this is zero. */ + unsigned int numlockModMask;/* Has one bit set to indicate the modifier + * corresponding to the "Numlock" key. If no + * such modifier, then this is zero. */ enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage; /* Indicates how to interpret lock modifier. */ int numModKeyCodes; /* Number of entries in modKeyCodes array
