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
99b94705
Commit
99b94705
authored
Jan 11, 2016
by
Michael Klein
Browse files
vi keys: translate ALT-h/j/k/l to arrow keys
parent
466d4da0
Changes
1
Show whitespace changes
Inline
Side-by-side
ScreenManager.c
View file @
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
);
...
...
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