repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: e0cd2fdb4b9ee09a7c9fa9e011ee371e7c1909bc:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit e0cd2fdb4b9ee09a7c9fa9e011ee371e7c1909bc
Author: Emanuele Giaquinta 
Date:   Tue Apr 29 13:17:54 2014 +0000

    Implement 'builtin-string:' actions.

diff --git a/src/keyboard.C b/src/keyboard.C
index 437b7e563573a56895f57b5f55ebae5565946cbc..
index ..aa149d233cebb62f9d70de459f4aeb03c9e59ae3 100644
--- 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
index 283ae2507fcc64827abf50562f3ccaa40cdeaf7f..
index ..ff8ff6b466592cec6499fd150bdd0006ae96ed7a 100644
--- 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-----