… | |
… | |
78 | // return: priority_of_a - priority_of_b |
78 | // return: priority_of_a - priority_of_b |
79 | static int |
79 | static int |
80 | compare_priority (keysym_t *a, keysym_t *b) |
80 | compare_priority (keysym_t *a, keysym_t *b) |
81 | { |
81 | { |
82 | // (the more '1's in state; the less range): the greater priority |
82 | // (the more '1's in state; the less range): the greater priority |
83 | int ca = rxvt_popcount (a->state /* & OtherModMask */); |
83 | int ca = ecb_popcount32 (a->state /* & OtherModMask */); |
84 | int cb = rxvt_popcount (b->state /* & OtherModMask */); |
84 | int cb = ecb_popcount32 (b->state /* & OtherModMask */); |
85 | |
85 | |
86 | if (ca != cb) |
86 | if (ca != cb) |
87 | return ca - cb; |
87 | return ca - cb; |
88 | //else if (a->state != b->state) // this behavior is to be discussed |
88 | //else if (a->state != b->state) // this behavior is to be discussed |
89 | // return b->state - a->state; |
89 | // return b->state - a->state; |
… | |
… | |
225 | wchar_t *wc = rxvt_utf8towcs (key.str); |
225 | wchar_t *wc = rxvt_utf8towcs (key.str); |
226 | char *str = rxvt_wcstombs (wc); |
226 | char *str = rxvt_wcstombs (wc); |
227 | // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.) |
227 | // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.) |
228 | free (wc); |
228 | free (wc); |
229 | |
229 | |
230 | switch (key.type) |
|
|
231 | { |
|
|
232 | case keysym_t::STRING: |
|
|
233 | output_string (term, str); |
230 | output_string (term, str); |
234 | break; |
|
|
235 | } |
|
|
236 | |
231 | |
237 | free (str); |
232 | free (str); |
238 | |
233 | |
239 | return true; |
234 | return true; |
240 | } |
235 | } |