ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: devel@altlinux.ru
Subject: [devel] Re: RFC: test-aboutdialog (GUI)
Date: Wed, 13 Jul 2005 08:06:54 +0400
Message-ID: <20050713040654.GB10741@solemn.turbinal.org> (raw)
In-Reply-To: <20050618225813.GI2751@solemn.turbinal.org>

[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]

On Sun, Jun 19, 2005 at 02:58:13AM +0400, Alexey Tourbin wrote:
> On Sun, Jun 19, 2005 at 02:10:26AM +0400, Alexey Tourbin wrote:
> > On Sat, Jun 18, 2005 at 08:36:36PM +0400, Alexey Tourbin wrote:
> > > Под Xvfb пока не работает, не знаю точно почему. :(
> > 
> > Под Xvfb не работает XKeysymToKeycode() -- возвращает 0.
> > Это в процессе запроса на нажатие Alt (keysym=65513).
> 
> $ cat xtest.c
> #include <stdio.h>
> #include <X11/Xlib.h>
> #include <X11/keysym.h>
> int main()
> {
>         Display *display = XOpenDisplay(NULL);
>         if (!display)
>                 return 1;
>         KeyCode kc = XKeysymToKeycode(display, XK_Alt_L);
>         printf("keycode=%d\n", kc);
>         return 0;
> }
> $ gcc -I/usr/X11R6/include -L/usr/X11R6/lib xtest.c -lX11
> $ DISPLAY=:0 ./a.out
> keycode=64
> $ xvfb-run -a ./a.out
> xauth:  creating new authority file /home/at/.Xauthority
> keycode=0
> $
> 
> У кого-нибудь воспроизводится?  Any ideas?

Проблема решилась так:

--- 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.

> NB: НЕ ЗАПУСКАЙТЕ xfvb-run в домашнем каталоге.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-07-13  4:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-18 16:36 [devel] " Alexey Tourbin
2005-06-18 18:26 ` [devel] " Konstantin A. Lepikhov
2005-06-18 19:02   ` Alexey Tourbin
2005-06-18 21:09     ` Konstantin A. Lepikhov
2005-06-18 22:10 ` Alexey Tourbin
2005-06-18 22:58   ` Alexey Tourbin
2005-07-13  4:06     ` Alexey Tourbin [this message]
2005-07-21 18:25       ` [devel] Xvfb keyboard Alexey Tourbin
2005-06-20  7:25 ` [devel] RFC: test-aboutdialog (GUI) Sviataslau Svirydau
2005-06-20 12:14   ` [devel] " Alexey Tourbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050713040654.GB10741@solemn.turbinal.org \
    --to=at@altlinux.ru \
    --cc=devel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git