Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
9c39422c
Commit
9c39422c
authored
Jan 13, 2016
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
ScreenManager.c
View file @
9c39422c
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment