ALT Linux repositórios
Group :: Gráficos
RPM: xli
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: 110-arrow_keys.patch
Download
Download
Make xli handle the arrow keys to move the image
in the specified direction. by Bernhard R. Link in #179268
Index: xli-1.17.0+20061110/window.c
===================================================================
--- xli-1.17.0+20061110.orig/window.c
+++ xli-1.17.0+20061110/window.c
@@ -800,8 +800,34 @@ char imageInWindow(DisplayInfo *dinfo, I
XComposeStatus status;
char ret;
Cursor cursor;
+ int num;
- if (XLookupString(&event.key, buf, 128, &ks, &status) != 1)
+ num = XLookupString(&event.key, buf, 128, &ks, &status);
+ if( num != 1 && ((image->width > winwidth) || (image->height > winheight))) {
+ switch (ks) {
+ case XK_Left:
+ case XK_KP_Left:
+ pixx += winwidth/10+1;
+ placeImage(disp, image->width, image->height, winwidth, winheight, &pixx, &pixy);
+ break;
+ case XK_Right:
+ case XK_KP_Right:
+ pixx -= winwidth/10+1;
+ placeImage(disp, image->width, image->height, winwidth, winheight, &pixx, &pixy);
+ break;
+ case XK_Up:
+ case XK_KP_Up:
+ pixy += winheight/10+1;
+ placeImage(disp, image->width, image->height, winwidth, winheight, &pixx, &pixy);
+ break;
+ case XK_Down:
+ case XK_KP_Down:
+ pixy -= winheight/10+1;
+ placeImage(disp, image->width, image->height, winwidth, winheight, &pixx, &pixy);
+ break;
+ }
+ }
+ if (num != 1)
break;
ret = buf[0];
if (isupper(ret))