… | |
… | |
236 | bool |
236 | bool |
237 | keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state) |
237 | keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state) |
238 | { |
238 | { |
239 | assert (hash[0] == 0 && "register_done() need to be called"); |
239 | assert (hash[0] == 0 && "register_done() need to be called"); |
240 | |
240 | |
241 | if (state & term->ModMetaMask) |
241 | if (state & term->ModMetaMask) state |= MetaMask; |
242 | state |= MetaMask; |
|
|
243 | |
|
|
244 | if (state & term->ModNumLockMask) |
242 | if (state & term->ModNumLockMask) state |= NumLockMask; |
245 | state |= NumLockMask; |
243 | if (state & term->ModLevel3Mask) state |= Level3Mask; |
246 | |
244 | |
247 | if (!!(term->priv_modes & PrivMode_aplKP) != !!(state & ShiftMask)) |
245 | if (!!(term->priv_modes & PrivMode_aplKP) != !!(state & ShiftMask)) |
248 | state |= AppKeypadMask; |
246 | state |= AppKeypadMask; |
249 | |
247 | |
250 | int index = find_keysym (keysym, state); |
248 | int index = find_keysym (keysym, state); |
… | |
… | |
435 | { |
433 | { |
436 | keysym_t *a = sorted_keymap[i]; |
434 | keysym_t *a = sorted_keymap[i]; |
437 | for (int j = 0; j < a->range; ++j) |
435 | for (int j = 0; j < a->range; ++j) |
438 | { |
436 | { |
439 | int index = find_keysym (a->keysym + j, a->state & OtherModMask); |
437 | int index = find_keysym (a->keysym + j, a->state & OtherModMask); |
|
|
438 | |
440 | assert (index >= 0); |
439 | assert (index >= 0); |
441 | keysym_t *b = keymap [index]; |
440 | keysym_t *b = keymap [index]; |
442 | assert (i == (signed) index || // the normally expected result |
441 | assert (i == (signed) index || // the normally expected result |
443 | (a->keysym + j) >= b->keysym && (a->keysym + j) <= (b->keysym + b->range) && compare_priority (a, b) <= 0); // is effectively the same |
442 | (a->keysym + j) >= b->keysym && (a->keysym + j) <= (b->keysym + b->range) && compare_priority (a, b) <= 0); // is effectively the same |
444 | } |
443 | } |