window: add support for emacs terminal

This commit is contained in:
Andrzej Rybczak
2015-09-12 22:56:18 +02:00
parent f28d60e0c7
commit 7e8156566a

View File

@@ -806,10 +806,20 @@ Key::Type Window::getInputChar(int key)
{ {
case '\t': // tty case '\t': // tty
return Key::Shift | Key::Tab; return Key::Shift | Key::Tab;
case 'O': // ctrl+arrows in rxvt, F1 to F4 in xterm case 'O':
key = wgetch(m_window); key = wgetch(m_window);
switch (key) switch (key)
{ {
// eterm
case 'A':
return Key::Up;
case 'B':
return Key::Down;
case 'C':
return Key::Right;
case 'D':
return Key::Left;
// rxvt
case 'a': case 'a':
return Key::Ctrl | Key::Up; return Key::Ctrl | Key::Up;
case 'b': case 'b':
@@ -818,6 +828,7 @@ Key::Type Window::getInputChar(int key)
return Key::Ctrl | Key::Right; return Key::Ctrl | Key::Right;
case 'd': case 'd':
return Key::Ctrl | Key::Left; return Key::Ctrl | Key::Left;
// xterm
case 'P': case 'P':
return Key::F1; return Key::F1;
case 'Q': case 'Q':