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
return Key::Shift | Key::Tab;
case 'O': // ctrl+arrows in rxvt, F1 to F4 in xterm
case 'O':
key = wgetch(m_window);
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':
return Key::Ctrl | Key::Up;
case 'b':
@@ -818,6 +828,7 @@ Key::Type Window::getInputChar(int key)
return Key::Ctrl | Key::Right;
case 'd':
return Key::Ctrl | Key::Left;
// xterm
case 'P':
return Key::F1;
case 'Q':