Commit 99b94705 authored by Michael Klein's avatar Michael Klein
Browse files

vi keys: translate ALT-h/j/k/l to arrow keys

parent 466d4da0
......@@ -244,6 +244,29 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
redraw = false;
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;
if (Panel_eventHandlerFn(panelFocus)) {
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