From unknown Thu Mar 28 12:52:40 2024 X-Loop: git-admin@x2go.org Subject: Bug#112: Mac Os X keyboard bug: NumLockMask always set, keyboard unusable Reply-To: benjamin milde , 112@bugs.x2go.org Resent-From: benjamin milde Resent-To: x2go-dev@lists.berlios.de X-Loop: git-admin@x2go.org Resent-Date: Wed, 30 Jan 2013 18:48:01 +0000 Resent-Message-ID: Resent-Sender: git-admin@x2go.org X-X2Go-PR-Message: report 112 X-X2Go-PR-Package: * X-X2Go-PR-Keywords: Received: via spool by submit@bugs.x2go.org id=B.135957091622145 (code B); Wed, 30 Jan 2013 18:48:01 +0000 Received: (at submit) by bugs.x2go.org; 30 Jan 2013 18:35:16 +0000 Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) by ymir (Postfix) with ESMTPS id 3E3A95DB16 for ; Wed, 30 Jan 2013 19:35:16 +0100 (CET) Received: by mail-ie0-f169.google.com with SMTP id c14so1614739ieb.28 for ; Wed, 30 Jan 2013 10:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=t3v3VkLtmqmx2BE/HaEPAm3E94BYNguHjGlTutV+oUc=; b=qea/15j33k0fXNM51hqltHCKXsy+KyGdjWLioy0r2KWd5oD7eocJwcPE2LWV2lxmjP TrAmPWtK1lnJTvjb2GyQ1qApLo836hSKN9loCKllJ3TK/RxzmBZ2o5pXVNNPcfLsbDQa pM/D9KEy3z3nNOCXdWIhVbyWua1eE9tXC2JgKGPhaxj7OmbUlxhlqNhXI2q4u0noYc0i d0IXZIuE56qF9ORUd6LAiKZu6GW9UF7TY/doVDzaHUcl9GocmL0LQgcHIrMBJim2T1LM mGkDJAK97U+XO3K8g2Kkq5w8TiHn+xxRkfxUFm9/Ifks1kgxgjO814n2K947c48ON8nH YkCQ== MIME-Version: 1.0 X-Received: by 10.50.151.211 with SMTP id us19mr4268912igb.84.1359570914376; Wed, 30 Jan 2013 10:35:14 -0800 (PST) Received: by 10.64.7.106 with HTTP; Wed, 30 Jan 2013 10:35:14 -0800 (PST) Date: Wed, 30 Jan 2013 19:35:14 +0100 Message-ID: From: benjamin milde To: submit@bugs.x2go.org Cc: Michael Nagel Content-Type: multipart/alternative; boundary=e89a8f3b9d5f65fb1d04d485c55c --e89a8f3b9d5f65fb1d04d485c55c Content-Type: text/plain; charset=UTF-8 Package: * Version: various versions tried out, see below * Buggy package name not known. I suspect a problem with nx-libraries. ------------------------------------------------------------------------------------------------ I can supply further information for the mac os x keyboard bug in x2go. I think I had this problem already ~2 years ago, when I first tried out x2go. All pressed client keys produce wrong key events on the host. Its a real show-stopper since it makes x2go basically totally unusable for me and others. See also this post on the x2go mailing list https://lists.berlios.de/pipermail/x2go-user/2012-November/001123.html There, Michael had the same problem I observe with: Server Side: Ubuntu 12.04 with x2goserver 3.1.1.6-0~610~precise1 from the stable PPA Client Side: Mac OS X 10.6.8 with x2goclient 3.99.2.1 from the x2go website Keyboard Layout: en_us everywhere, and in x2goclient I checked "Keep current keyboard Settings" I'm using Mac OS X 10.8.2, XQuarz 2.7.4 and also x2goclient 3.99.2.1. I also tried changing x2goserver from stable PPA to 4.1.0 from git. Also toggling "Keep current keyboard Settings" does not make a difference. Server is also a ubuntu machine, but could cross-check this with a Debian install (and see if the same error occurs there). The problem is that keystate changes while it is transferred to the host: MAC: state 0x0, keycode 26 (keysym 0x31, 1), same_screen YES, LINUX: state 0x10, keycode 26 (keysym 0x65, e), same_screen YES, This makes the keyboard unusable, since every client keycode gives a wrong keysym on the host. The mask 0x10 is set for all key events sent to the host, every time. Looking around in X's headers I found: defined in /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, state in various key-, mouse-, and button-related events. */ #define ShiftMask (1<<0) #define LockMask (1<<1) #define ControlMask (1<<2) #define Mod1Mask (1<<3) #define Mod2Mask (1<<4) #define Mod3Mask (1<<5) #define Mod4Mask (1<<6) #define Mod5Mask (1<<7) So keystate 0x10 means the keyevent has Mod2Mask set. defined in (but don't think it's a standard X11 header) #define AltMask Mod1Mask #define NumLockMask Mod2Mask #define AltLangMask Mod3Mask #define KanaMask Mod4Mask #define ScrollLockMask Mod5Mask Which appears to be a NumLockMask. This makes sense since 'dfg' gives the numbers '124', i.e. indicating that I have some sort of Numpad overlay in the middle of the keyboard on the host. For what is worth, a found similar bug report with no machines remote desktop. http://apple.stackexchange.com/questions/31691/no-machine-remote-desktop-issue "For instance, the Delete key was now comma, all the letters were transposed, general chaos. " I can also confirm that backspace is comma, so this seems to be the same NumLockMask problem. Every key is garbled, but not randomly. The same problems apparently appears here in a bug report in XQuartz. They think its not their fault: http://xquartz.macosforge.org/trac/ticket/471 Quote: "From my experience using NX in Linux, NX is badly designed. It sends keycodes instead of KeySyms to the remote NX session. This causes the remote session to behave badly, unless you install the local keyboard map into the remote X session. It is a problem with NX and not the X server. However, that should have no effect on the local keyboard mapping. " If someone could point me in the right direction, I would be glad to help. And as I have no need for the Mod2Mask, as a temporary fix, I would be fine to ignore this mask on the server side and hard code xkey->state &= ~(1u << 4); somewhere. Has someone an idea how to further investigate this issue? Is there someone who can report a working keyboard with Mac Os X as client? --e89a8f3b9d5f65fb1d04d485c55c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Package: *
Version: various versions tried out, se= e below

* Buggy package name not known. I suspect a problem wit= h nx-libraries.

----------------------------------= --------------------------------------------------------------
=
I can supply further information for the mac os x keyboard bug in= x2go. I think I had this problem already ~2 years ago, when I first tried = out x2go. All pressed client keys produce wrong key events on the host. Its= a real show-stopper since it makes x2go basically totally unusable for me = and others.

There, Michael had the same problem I observe with:

=
Server Side: Ubuntu 12.04 with x2goserver 3.1.1.6-0~610~precise1 = from the stable PPA
Client Side: Mac OS X 10.6.8 with x2goclient 3.99.2.1 from the x2= go website
Keyboard Layout: en_us everywhere, and in x2goclient I checked &q= uot;Keep current keyboard Settings"

I'm using Mac OS X 10.8.2, = XQuarz 2.7.4 and also x2goclient 3.99.2.1. I also tried changing x2goserver= from stable PPA to 4.1.0 from git. Also toggling "Keep current keyboa= rd Settings" does not make a difference. Server is also a ubuntu machi= ne, but could cross-check this with a Debian install (and see if the same e= rror occurs there).

The problem is that keystate ch= anges while it is transferred to the host:

MAC: =C2=A0 state 0x0, keycode = 26 (keysym 0x31, 1), same_screen YES,
LINUX: state 0x10, keycode 26 (keysym 0x65, e), same_screen YES,<= /span>

This makes the keyboard unusabl= e, since every client keycode gives a wrong keysym on the host. The mask 0x= 10 is set for all key events sent to the host, every time.

Looking around in X's heade= rs I found:

defined in <X.h>
/* Key masks. Used as modifiers to GrabButton and GrabKey, result= s of QueryPointer,
=C2=A0 =C2=A0state in various key-, mouse-, and button-related ev= ents. */
#define ShiftMask =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (1<<0)
#define LockMask =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1<<1)<= /div>
#define ControlMask =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (1<<2)
#define Mod1Mask =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(1<<3)
#define Mod2Mask =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1<<4)<= /div>
#define Mod3Mask =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(1<<5)
#define Mod4Mask =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(1<<6)
#define Mod5Mask =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1<<7)<= /div>

So keystate 0x10 means the keyevent has Mod2M= ask set.

defined in <xorg/atKeynames.= h> (but don't think it's a standard X11 header)
#define AltMask =C2=A0 =C2=A0 =C2=A0 =C2=A0 Mod1Mask
#define NumLockMask =C2= =A0 =C2=A0 Mod2Mask
#define AltLangMask =C2=A0= =C2=A0 Mod3Mask
#define KanaMask =C2=A0 =C2=A0 =C2=A0 =C2=A0Mod4Mask
#define ScrollLockMask = =C2=A0Mod5Mask

Which appears to be a NumLockMask. This makes= sense since 'dfg' gives the numbers '124', i.e. indicating= that I have some sort of Numpad overlay in the middle of the keyboard on t= he host. =C2=A0

For what is worth, a found simi= lar bug report with no machines remote desktop. http://appl= e.stackexchange.com/questions/31691/no-machine-remote-desktop-issue

=C2=A0"For instance, the D= elete key was now comma, all the letters were transposed, general chaos. &q= uot;

I can also confirm that backspa= ce is comma, so this seems to be the same NumLockMask problem. Every key is= garbled, but not randomly.

The same problems=C2=A0apparent= ly=C2=A0appears here in a bug report in XQuartz. They think its not their f= ault:


Quote:
"From my experience using NX in Linux, NX is badly designed.= It sends keycodes instead of KeySyms to the remote NX session.
=C2=A0This causes the remote session to behave badly, unless you = install the local keyboard map into the remote X session.
It is a problem with NX and not the X server. However, that shoul= d have no effect on the local keyboard mapping. "

If someone could point me in th= e right direction, I would be glad to help.=C2=A0
And as I have no need for the Mod2Mask, as a temporary fix, I wou= ld be fine to ignore this mask on the server side and hard code xkey->st= ate &=3D ~(1u << 4); somewhere.

Has someone an idea how to furt= her investigate this issue? Is there someone who can report a working keybo= ard with Mac Os X as client?

--e89a8f3b9d5f65fb1d04d485c55c--