repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: e0cd2fdb4b9ee09a7c9fa9e011ee371e7c1909bc: path_to: revision_to:
commit e0cd2fdb4b9ee09a7c9fa9e011ee371e7c1909bc Author: Emanuele GiaquintaDate: Tue Apr 29 13:17:54 2014 +0000 Implement 'builtin-string:' actions. diff --git a/src/keyboard.C b/src/keyboard.C
--- a/src/keyboard.C
+++ b/src/keyboard.C
@@ -104,6 +104,8 @@ keyboard_manager::register_user_translation (KeySym keysym, unsigned int state,
if (strncmp (translation, "builtin:", 8) == 0)
key->type = keysym_t::BUILTIN;
+ else if (strncmp (translation, "builtin-string:", 15) == 0)
+ key->type = keysym_t::BUILTIN_STRING;
if (keymap.size () == keymap.capacity ())
keymap.reserve (keymap.size () * 2);
@@ -132,7 +134,12 @@ keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state,
{
keysym_t *key = keymap [index];
- if (key->type != keysym_t::BUILTIN)
+ if (key->type == keysym_t::BUILTIN_STRING)
+ {
+ term->tt_write_user_input (kbuf, len);
+ return true;
+ }
+ else if (key->type != keysym_t::BUILTIN)
{
wchar_t *ws = rxvt_utf8towcs (key->str);
char *str = rxvt_wcstombs (ws);
diff --git a/src/keyboard.h b/src/keyboard.h
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -50,7 +50,7 @@ struct rxvt_term;
struct keysym_t
{
enum keysym_type {
- STRING, BUILTIN,
+ STRING, BUILTIN, BUILTIN_STRING,
};
KeySym keysym;
-----END OF PAGE-----