Krolyxon
Commit 019e227

Branches

Refs →

nsxiv019e227

Map arrow keys to h/j/k/l

Author
Bert
Date
2011-01-28 13:42 +0100
Parent
8123d63
Commit
019e2274a88f35668bc6687eb4ed5ca16f7cf066

+21 −9

3 files changed

  1. M README.md +3 −3
  2. M main.c +12 −0
  3. M sxiv.1 +6 −6
M README.md View
@@ -45,13 +45,13 @@ Use the following keys to control sxiv:
4545
4646 q Quit sxiv
4747 Escape Quit sxiv and return an exit value of 2 (useful for scripting)
48− Space,n Go to the next image
49− Backspace,p Go to the previous image
48+ n,Space Go to the next image
49+ p,Backspace Go to the previous image
5050 g/G Go to first/last image
5151 [/] Go 10 images backward/forward
5252 +,= Zoom in
5353 - Zoom out
54− h,j,k,l Pan image left/down/up/right
54+ h,j,k,l Pan image left/down/up/right (also with arrow keys)
5555 <,> Rotate image (counter-)clockwise by 90 degrees
5656 f Toggle fullscreen mode (requires an EWMH/NetWM compliant
5757 window manager)
M main.c View
@@ -149,6 +149,18 @@ void on_keypress(XEvent *ev) {
149149 case XK_BackSpace:
150150 key = 'p';
151151 break;
152+ case XK_Left:
153+ key = 'h';
154+ break;
155+ case XK_Down:
156+ key = 'j';
157+ break;
158+ case XK_Up:
159+ key = 'k';
160+ break;
161+ case XK_Right:
162+ key = 'l';
163+ break;
152164 }
153165
154166 switch (key) {
M sxiv.1 View
@@ -63,10 +63,10 @@ Quit sxiv.
6363 Quit sxiv and return an exit value of 2.
6464 .SS Navigate image list
6565 .TP
66−.BR Space ", " n
66+.BR n ", " Space
6767 Go to the next image.
6868 .TP
69−.BR Backspace ", " p
69+.BR p ", " Backspace
7070 Go to the previous image.
7171 .TP
7272 .B g
@@ -89,16 +89,16 @@ Zoom in.
8989 Zoom out.
9090 .SS Panning
9191 .TP
92−.B h
92+.BR h ", " Left
9393 Pan left.
9494 .TP
95−.B j
95+.BR j ", " Down
9696 Pan down.
9797 .TP
98−.B k
98+.BR k ", " Up
9999 Pan up.
100100 .TP
101−.B l
101+.BR l ", " Right
102102 Pan right.
103103 .SS Rotation
104104 .TP