Skip Menu |

This queue is for tickets about the X11-GUITest CPAN distribution.

Report information
The Basics
Id: 13682
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: X11-GUITest

People
Owner: ctrondlp [...] cpan.org
Requestors: at [...] altlinux.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.20
Fixed in: (no value)



Subject: XK_Alt_L should fall back to XK_Meta_L
Hello, Xvfb lacks XK_Alt_L keycode, so pressing ALT-something (e.g. SendKeys($win, '%(h)a') for Help->About) simply does not work -- XKeysymToKeycode(display, XK_Meta_L) returns 0. (Xvfb is a virtual X server that comes with XFree86 and XOrg; it can run on machines with no display hardware and no physical input devices, thus being a good choice for automated GUI testing.) The following patch implements fallback to XK_Meta_L: --- X11-GUITest-0.20/GUITest.xs- 2004-01-16 23:41:42 +0000 +++ X11-GUITest-0.20/GUITest.xs 2005-07-13 01:35:14 +0000 @@ -213,6 +213,15 @@ return( GetKeySym(key, sym) ); } +/* Xvfb lacks XK_Alt_L; fall back to XK_Meta_L */ +#define XKeysymToKeycode(display, sym) \ +({ Display *d = (display); KeySym s = (sym); \ + KeyCode kc = (XKeysymToKeycode)(d, s); \ + if (kc == 0 && s == XK_Alt_L) \ + kc = (XKeysymToKeycode)(d, XK_Meta_L); \ + kc; \ +}) + /* Function: PressKeyImp * Description: Presses the key for the specified keysym. Lower-level * implementation. End of patch It simply wraps XKeysymToKeycode() function into a macro. (This syntax is GCC extension; it works fine for me now, though.) -- Alexey Tourbin ALT Linux Team
This issue has been resolved in X11-GUITest v0.21. Please see below. From ChangeLog: - Applied patches cpan #13682(XK_Meta_L fallback) and cpan #13684 (StartApp) from Alexey Tourbin. Compiler define X11_GUITEST_ALT_L_FALLBACK_META_L enabled by default.