aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-01-28 13:42:39 +0100
committerBert <ber.t@gmx.com>2011-01-28 13:42:39 +0100
commit019e2274a88f35668bc6687eb4ed5ca16f7cf066 (patch)
treeae991aa151817193b964aa3035a800246822ed22
parent8123d63c5b76909ce70f09614ac0e45760a69d71 (diff)
Map arrow keys to h/j/k/l
-rw-r--r--README.md6
-rw-r--r--main.c12
-rw-r--r--sxiv.112
3 files changed, 21 insertions, 9 deletions
diff --git a/README.md b/README.md
index 1f9f0d2..6cf1f68 100644
--- a/README.md
+++ b/README.md
@@ -45,13 +45,13 @@ Use the following keys to control sxiv:
q Quit sxiv
Escape Quit sxiv and return an exit value of 2 (useful for scripting)
- Space,n Go to the next image
- Backspace,p Go to the previous image
+ n,Space Go to the next image
+ p,Backspace Go to the previous image
g/G Go to first/last image
[/] Go 10 images backward/forward
+,= Zoom in
- Zoom out
- h,j,k,l Pan image left/down/up/right
+ h,j,k,l Pan image left/down/up/right (also with arrow keys)
<,> Rotate image (counter-)clockwise by 90 degrees
f Toggle fullscreen mode (requires an EWMH/NetWM compliant
window manager)
diff --git a/main.c b/main.c
index 7d1e682..aa21426 100644
--- a/main.c
+++ b/main.c
@@ -149,6 +149,18 @@ void on_keypress(XEvent *ev) {
case XK_BackSpace:
key = 'p';
break;
+ case XK_Left:
+ key = 'h';
+ break;
+ case XK_Down:
+ key = 'j';
+ break;
+ case XK_Up:
+ key = 'k';
+ break;
+ case XK_Right:
+ key = 'l';
+ break;
}
switch (key) {
diff --git a/sxiv.1 b/sxiv.1
index 083ae90..a17e3e0 100644
--- a/sxiv.1
+++ b/sxiv.1
@@ -63,10 +63,10 @@ Quit sxiv.
Quit sxiv and return an exit value of 2.
.SS Navigate image list
.TP
-.BR Space ", " n
+.BR n ", " Space
Go to the next image.
.TP
-.BR Backspace ", " p
+.BR p ", " Backspace
Go to the previous image.
.TP
.B g
@@ -89,16 +89,16 @@ Zoom in.
Zoom out.
.SS Panning
.TP
-.B h
+.BR h ", " Left
Pan left.
.TP
-.B j
+.BR j ", " Down
Pan down.
.TP
-.B k
+.BR k ", " Up
Pan up.
.TP
-.B l
+.BR l ", " Right
Pan right.
.SS Rotation
.TP