nsxiv019e227
Map arrow keys to h/j/k/l
+21 −9
3 files changed
| @@ -45,13 +45,13 @@ Use the following keys to control sxiv: | |||
| 45 | 45 | ||
| 46 | 46 | q Quit sxiv | |
| 47 | 47 | 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 | |
| 50 | 50 | g/G Go to first/last image | |
| 51 | 51 | [/] Go 10 images backward/forward | |
| 52 | 52 | +,= Zoom in | |
| 53 | 53 | - 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) | |
| 55 | 55 | <,> Rotate image (counter-)clockwise by 90 degrees | |
| 56 | 56 | f Toggle fullscreen mode (requires an EWMH/NetWM compliant | |
| 57 | 57 | window manager) | |
| @@ -149,6 +149,18 @@ void on_keypress(XEvent *ev) { | |||
| 149 | 149 | case XK_BackSpace: | |
| 150 | 150 | key = 'p'; | |
| 151 | 151 | 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; | |
| 152 | 164 | } | |
| 153 | 165 | ||
| 154 | 166 | switch (key) { | |
| @@ -63,10 +63,10 @@ Quit sxiv. | |||
| 63 | 63 | Quit sxiv and return an exit value of 2. | |
| 64 | 64 | .SS Navigate image list | |
| 65 | 65 | .TP | |
| 66 | − | .BR Space ", " n | |
| 66 | + | .BR n ", " Space | |
| 67 | 67 | Go to the next image. | |
| 68 | 68 | .TP | |
| 69 | − | .BR Backspace ", " p | |
| 69 | + | .BR p ", " Backspace | |
| 70 | 70 | Go to the previous image. | |
| 71 | 71 | .TP | |
| 72 | 72 | .B g | |
| @@ -89,16 +89,16 @@ Zoom in. | |||
| 89 | 89 | Zoom out. | |
| 90 | 90 | .SS Panning | |
| 91 | 91 | .TP | |
| 92 | − | .B h | |
| 92 | + | .BR h ", " Left | |
| 93 | 93 | Pan left. | |
| 94 | 94 | .TP | |
| 95 | − | .B j | |
| 95 | + | .BR j ", " Down | |
| 96 | 96 | Pan down. | |
| 97 | 97 | .TP | |
| 98 | − | .B k | |
| 98 | + | .BR k ", " Up | |
| 99 | 99 | Pan up. | |
| 100 | 100 | .TP | |
| 101 | − | .B l | |
| 101 | + | .BR l ", " Right | |
| 102 | 102 | Pan right. | |
| 103 | 103 | .SS Rotation | |
| 104 | 104 | .TP | |