Commit 9c39422c authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Merge pull request #346 from mklein-de/vikeys

vi keys: translate ALT-h/j/k/l to arrow keys
parents 466d4da0 99b94705
...@@ -244,6 +244,29 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { ...@@ -244,6 +244,29 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
redraw = false; redraw = false;
continue; continue;
} }
else if (ch == 27) {
int ch2 = getch();
if (ch2 != ERR) {
switch(ch2)
{
case 'h':
ch = KEY_LEFT;
break;
case 'j':
ch = KEY_DOWN;
break;
case 'k':
ch = KEY_UP;
break;
case 'l':
ch = KEY_RIGHT;
break;
default:
ungetch(ch2);
break;
}
}
}
redraw = true; redraw = true;
if (Panel_eventHandlerFn(panelFocus)) { if (Panel_eventHandlerFn(panelFocus)) {
result = Panel_eventHandler(panelFocus, ch); result = Panel_eventHandler(panelFocus, ch);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment