… | |
… | |
24 | #include "../config.h" |
24 | #include "../config.h" |
25 | #include "rxvt.h" |
25 | #include "rxvt.h" |
26 | |
26 | |
27 | #ifdef KEYSYM_RESOURCE |
27 | #ifdef KEYSYM_RESOURCE |
28 | |
28 | |
29 | #include <cstring> |
29 | #include <string.h> |
30 | |
30 | |
31 | #include "rxvtperl.h" |
31 | #include "rxvtperl.h" |
32 | #include "keyboard.h" |
32 | #include "keyboard.h" |
33 | #include "command.h" |
|
|
34 | |
33 | |
35 | /* an intro to the data structure: |
34 | /* an intro to the data structure: |
36 | * |
35 | * |
37 | * vector keymap[] is grouped. |
36 | * vector keymap[] is grouped. |
38 | * |
37 | * |
… | |
… | |
169 | |
168 | |
170 | void |
169 | void |
171 | keyboard_manager::register_done () |
170 | keyboard_manager::register_done () |
172 | { |
171 | { |
173 | unsigned int i, index, hashkey; |
172 | unsigned int i, index, hashkey; |
174 | vector <keysym_t *> sorted_keymap; |
|
|
175 | uint16_t hash_bucket_size[KEYSYM_HASH_BUCKETS]; // size of each bucket |
173 | uint16_t hash_bucket_size[KEYSYM_HASH_BUCKETS]; // size of each bucket |
176 | |
174 | |
177 | memset (hash_bucket_size, 0, sizeof (hash_bucket_size)); |
175 | memset (hash_bucket_size, 0, sizeof (hash_bucket_size)); |
178 | |
176 | |
179 | // determine hash bucket size |
177 | // determine hash bucket size |
… | |
… | |
191 | index += hash_bucket_size [i - 1]; |
189 | index += hash_bucket_size [i - 1]; |
192 | hash [i] = index; |
190 | hash [i] = index; |
193 | } |
191 | } |
194 | |
192 | |
195 | // and allocate just enough space |
193 | // and allocate just enough space |
196 | sorted_keymap.insert (sorted_keymap.begin (), index + hash_bucket_size [i - 1], 0); |
194 | simplevec <keysym_t *> sorted_keymap (index + hash_bucket_size [i - 1], 0); |
197 | |
195 | |
198 | memset (hash_bucket_size, 0, sizeof (hash_bucket_size)); |
196 | memset (hash_bucket_size, 0, sizeof (hash_bucket_size)); |
199 | |
197 | |
200 | // fill in sorted_keymap |
198 | // fill in sorted_keymap |
201 | // it is sorted in each bucket |
199 | // it is sorted in each bucket |