Terminology: Support CTRL+Arrow sequences.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 18 Jun 2012 08:07:41 +0000 (08:07 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 18 Jun 2012 08:07:41 +0000 (08:07 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/terminology@72368 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/keyin.c

index 034ff60..f8ec0e6 100644 (file)
@@ -37,6 +37,16 @@ static const Keyout appcur_keyout[] =
    KEY(NULL, "END")
 };
 
+static const Keyout ctrl_keyout[] =
+{
+   KEY("Left",         "\033[1;5D"),
+   KEY("Right",        "\033[1;5C"),
+   KEY("Up",           "\033[1;5A"),
+   KEY("Down",         "\033[1;5B"),
+   
+   KEY(NULL, "END")
+};
+
 static const Keyout keyout[] =
 {
    KEY("BackSpace",    "\177"),
@@ -184,7 +194,6 @@ keyin_handle(Termpty *ty, Evas_Event_Key_Down *ev)
      {
         if (_key_try(ty, appcur_keyout, ev)) return;
      }
-   if (_key_try(ty, keyout, ev)) return;
    if (
        ((ty->state.alt_kp) &&
            (evas_key_modifier_is_set(ev->modifiers, "Shift"))) ||
@@ -209,7 +218,12 @@ keyin_handle(Termpty *ty, Evas_Event_Key_Down *ev)
              termpty_write(ty, "\0", 1); // generate 0 byte for ctrl+space
              return;
           }
+        else if (!evas_key_modifier_is_set(ev->modifiers, "Shift"))
+          {
+             if (_key_try(ty, ctrl_keyout, ev)) return;
+          }
      }
+   if (_key_try(ty, keyout, ev)) return;
    if (ev->string)
      {
         if ((ev->string[0]) && (!ev->string[1]))