… | |
… | |
132 | |
132 | |
133 | keymap.push_back (key); |
133 | keymap.push_back (key); |
134 | hash[0] = 3; |
134 | hash[0] = 3; |
135 | } |
135 | } |
136 | |
136 | |
137 | bool |
137 | keysym_t * |
138 | keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state, const char *kbuf, int len) |
138 | keyboard_manager::lookup_keysym (rxvt_term *term, KeySym keysym, unsigned int state) |
139 | { |
139 | { |
140 | assert (("register_done() need to be called", hash[0] == 0)); |
140 | assert (("register_done() need to be called", hash[0] == 0)); |
141 | |
141 | |
142 | state &= OtherModMask; // mask out uninteresting modifiers |
142 | state &= OtherModMask; // mask out uninteresting modifiers |
143 | |
143 | |
… | |
… | |
148 | if (!!(term->priv_modes & PrivMode_aplKP) != !!(state & ShiftMask)) |
148 | if (!!(term->priv_modes & PrivMode_aplKP) != !!(state & ShiftMask)) |
149 | state |= AppKeypadMask; |
149 | state |= AppKeypadMask; |
150 | |
150 | |
151 | int index = find_keysym (keysym, state); |
151 | int index = find_keysym (keysym, state); |
152 | |
152 | |
153 | if (index >= 0) |
153 | return index >= 0 ? keymap [index] : 0; |
154 | { |
154 | } |
155 | keysym_t *key = keymap [index]; |
|
|
156 | |
155 | |
|
|
156 | bool |
|
|
157 | keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state, const char *kbuf, int len) |
|
|
158 | { |
|
|
159 | keysym_t *key = lookup_keysym (term, keysym, state); |
|
|
160 | |
|
|
161 | if (key) |
|
|
162 | { |
157 | if (key->type == keysym_t::BUILTIN_STRING) |
163 | if (key->type == keysym_t::BUILTIN_STRING) |
158 | { |
164 | { |
159 | term->tt_write_user_input (kbuf, len); |
165 | term->tt_write_user_input (kbuf, len); |
160 | return true; |
166 | return true; |
161 | } |
167 | } |