… | |
… | |
102 | key->str = translation; |
102 | key->str = translation; |
103 | key->type = keysym_t::STRING; |
103 | key->type = keysym_t::STRING; |
104 | |
104 | |
105 | if (strncmp (translation, "builtin:", 8) == 0) |
105 | if (strncmp (translation, "builtin:", 8) == 0) |
106 | key->type = keysym_t::BUILTIN; |
106 | key->type = keysym_t::BUILTIN; |
|
|
107 | else if (strncmp (translation, "builtin-string:", 15) == 0) |
|
|
108 | key->type = keysym_t::BUILTIN_STRING; |
107 | |
109 | |
108 | if (keymap.size () == keymap.capacity ()) |
110 | if (keymap.size () == keymap.capacity ()) |
109 | keymap.reserve (keymap.size () * 2); |
111 | keymap.reserve (keymap.size () * 2); |
110 | |
112 | |
111 | keymap.push_back (key); |
113 | keymap.push_back (key); |
… | |
… | |
130 | |
132 | |
131 | if (index >= 0) |
133 | if (index >= 0) |
132 | { |
134 | { |
133 | keysym_t *key = keymap [index]; |
135 | keysym_t *key = keymap [index]; |
134 | |
136 | |
|
|
137 | if (key->type == keysym_t::BUILTIN_STRING) |
|
|
138 | { |
|
|
139 | term->tt_write_user_input (kbuf, len); |
|
|
140 | return true; |
|
|
141 | } |
135 | if (key->type != keysym_t::BUILTIN) |
142 | else if (key->type != keysym_t::BUILTIN) |
136 | { |
143 | { |
137 | wchar_t *ws = rxvt_utf8towcs (key->str); |
144 | wchar_t *ws = rxvt_utf8towcs (key->str); |
138 | char *str = rxvt_wcstombs (ws); |
145 | char *str = rxvt_wcstombs (ws); |
139 | // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.) |
146 | // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.) |
140 | free (ws); |
147 | free (ws); |