ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/keyboard.C
(Generate patch)

Comparing rxvt-unicode/src/keyboard.C (file contents):
Revision 1.61 by sf-exg, Sat Apr 26 15:05:17 2014 UTC vs.
Revision 1.62 by root, Sat Apr 26 18:53:51 2014 UTC

61 * where hashkey of keymap[i]->keysym = keymap[i]->keysym & KEYSYM_HASH_MASK 61 * where hashkey of keymap[i]->keysym = keymap[i]->keysym & KEYSYM_HASH_MASK
62 * n(the number of groups) = the number of non-zero member of hash_bucket_size[]; 62 * n(the number of groups) = the number of non-zero member of hash_bucket_size[];
63 * Ni(the size of group i) = hash_bucket_size[Ii]. 63 * Ni(the size of group i) = hash_bucket_size[Ii].
64 */ 64 */
65 65
66static void
67output_string (rxvt_term *term, const char *str)
68{
69 if (strncmp (str, "command:", 8) == 0)
70 term->cmdbuf_append (str + 8, strlen (str) - 8);
71 else if (strncmp (str, "perl:", 5) == 0)
72 HOOK_INVOKE((term, HOOK_USER_COMMAND, DT_STR, str + 5, DT_END));
73 else
74 term->tt_write (str, strlen (str));
75}
76
77// return: priority_of_a - priority_of_b 66// return: priority_of_a - priority_of_b
78static int 67static int
79compare_priority (keysym_t *a, keysym_t *b) 68compare_priority (keysym_t *a, keysym_t *b)
80{ 69{
81 // (the more '1's in state; the less range): the greater priority 70 // (the more '1's in state; the less range): the greater priority
148 wchar_t *ws = rxvt_utf8towcs (key->str); 137 wchar_t *ws = rxvt_utf8towcs (key->str);
149 char *str = rxvt_wcstombs (ws); 138 char *str = rxvt_wcstombs (ws);
150 // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.) 139 // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.)
151 free (ws); 140 free (ws);
152 141
153 output_string (term, str); 142 if (char *colon = strchr (str, ':'))
143 {
144 if (strncmp (str, "command:", 8) == 0)
145 term->cmdbuf_append (str + 8, strlen (str) - 8);
146 else if (strncmp (str, "perl:", 8) == 0)
147 HOOK_INVOKE ((term, HOOK_USER_COMMAND, DT_STR, colon + 1, DT_END));
148 else if (HOOK_INVOKE ((term, HOOK_KEYBOARD_DISPATCH, DT_STR_LEN, str, colon - str, DT_STR, colon + 1, DT_END)))
149 /* done */;
150 else
151 term->tt_write (str, strlen (str));
152 }
154 153
155 free (str); 154 free (str);
156 155
157 return true; 156 return true;
158 } 157 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines