summaryrefslogtreecommitdiff
path: root/src/bin/keyin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/keyin.c')
-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,
146 return; 146 return;
147 } 147 }
148 } 148 }
149 if (ev->key && ev->key[0] == 'K' && ev->key[1] == 'k') 149 if (ev->key[0] == 'K' && ev->key[1] == 'k')
150 { 150 {
151 if (!evas_key_lock_is_set(ev->locks, "Num_Lock")) 151 if (!evas_key_lock_is_set(ev->locks, "Num_Lock"))
152 { 152 {
@@ -171,6 +171,28 @@ _handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
171 alt, shift, ctrl)) 171 alt, shift, ctrl))
172 return; 172 return;
173 173
174 if (ctrl)
175 {
176#define CTRL_NUM(Num, Code) \
177 if (!strcmp(ev->key, Num)) \
178 { \
179 if (alt) \
180 termpty_write(ty, "\033"Code, 2); \
181 else \
182 termpty_write(ty, Code, 1); \
183 return; \
184 }
185 CTRL_NUM("2", "\0")
186 CTRL_NUM("3", "\x1b")
187 CTRL_NUM("4", "\x1c")
188 CTRL_NUM("5", "\x1d")
189 CTRL_NUM("6", "\x1e")
190 CTRL_NUM("7", "\x1f")
191 CTRL_NUM("8", "\x7f")
192
193#undef CTRL_NUM
194 }
195
174 if (ev->string) 196 if (ev->string)
175 { 197 {
176 if (alt) 198 if (alt)