aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-09-14 00:01:01 +0200
committerBoris Faure <billiob@gmail.com>2015-09-16 19:21:27 +0200
commit6582eff5cd82a210178818affcf87722a9c0b7ae (patch)
treef80c092686c56d39e5e3a9a83327963ea9fc9c79
parenttermpty: fix resizing (diff)
downloadterminology-6582eff5cd82a210178818affcf87722a9c0b7ae.tar.gz
ctrl-[2-8] are now handled by terminology. Ref https://phab.enlightenment.org/T2723
-rw-r--r--src/bin/keyin.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/bin/keyin.c b/src/bin/keyin.c
index f5bc81e..b17f4fa 100644
--- a/src/bin/keyin.c
+++ b/src/bin/keyin.c
@@ -146,7 +146,7 @@ _handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
return;
}
}
- if (ev->key && ev->key[0] == 'K' && ev->key[1] == 'k')
+ if (ev->key[0] == 'K' && ev->key[1] == 'k')
{
if (!evas_key_lock_is_set(ev->locks, "Num_Lock"))
{
@@ -171,6 +171,28 @@ _handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
alt, shift, ctrl))
return;
+ if (ctrl)
+ {
+#define CTRL_NUM(Num, Code) \
+ if (!strcmp(ev->key, Num)) \
+ { \
+ if (alt) \
+ termpty_write(ty, "\033"Code, 2); \
+ else \
+ termpty_write(ty, Code, 1); \
+ return; \
+ }
+ CTRL_NUM("2", "\0")
+ CTRL_NUM("3", "\x1b")
+ CTRL_NUM("4", "\x1c")
+ CTRL_NUM("5", "\x1d")
+ CTRL_NUM("6", "\x1e")
+ CTRL_NUM("7", "\x1f")
+ CTRL_NUM("8", "\x7f")
+
+#undef CTRL_NUM
+ }
+
if (ev->string)
{
if (alt)