From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25855 invoked by alias); 1 Aug 2011 14:57:33 -0000 Received: (qmail 25841 invoked by uid 22791); 1 Aug 2011 14:57:31 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtpout.karoo.kcom.com (HELO smtpout.karoo.kcom.com) (212.50.160.34) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Aug 2011 14:57:16 +0000 Received: from 213-152-38-55.dsl.eclipse.net.uk (HELO [192.168.0.8]) ([213.152.38.55]) by smtpout.karoo.kcom.com with ESMTP; 01 Aug 2011 15:57:14 +0100 Message-ID: <4E36BED6.3070102@dronecode.org.uk> Date: Mon, 01 Aug 2011 14:57:00 -0000 From: Jon TURNEY Reply-To: cygwin-xfree , Paul Maier User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20110714 Thunderbird/6.0 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com Subject: Re: AltGr key mostly fires an additional CONTROL key References: <006301cc4fb3$2696d060$73c47120$@de> In-Reply-To: <006301cc4fb3$2696d060$73c47120$@de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com X-SW-Source: 2011-08/txt/msg00000.txt.bz2 On 31/07/2011 19:53, Paul Maier wrote: > Hi Jon, > > another issue with the keyboard on a Lenovo T60 (Windows XP) and > Lenovo T510 (Windows 7). > > The AltGr key mostly fires and locks (!) an additional CONTROL key press. > This makes the AltGr key basically inusable (and a xmodmap workaround is not > possible). > > The AltGr key is a modifier key e. g. needed to get the @ sign (AltGr + Q) on a > German keyboard. > > > This is, what I found out on this issue: > ---------------------------------------- > > This is the output of xev when that occured. I pressed AltGR+Q once and > released it again. > Then (without any other modifier key pressed) I hit once a normal A. > As you can see, instead of a @ I get a CONTROL-@ (= control character 00) and > instead of an a I get a CONTROL-A (= control character 01). > xev logs out very clear that there is an additionally (unwanted) KeyPress for > key 37 = CONTROL_L. > There is no KeyRelease for the keycode 37 = CONTROL_L in the log: > > > KeyPress event, serial 23, synthetic NO, window 0xa00001, > root 0x101, subw 0xa00002, time 32794468, (47,57), root:(73,99), > state 0x10, keycode 113 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, > XLookupString gives 0 bytes: > XFilterEvent returns: False > > KeyPress event, serial 23, synthetic NO, window 0xa00001, > root 0x101, subw 0xa00002, time 32795046, (47,57), root:(73,99), > state 0x90, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, > XLookupString gives 0 bytes: > XFilterEvent returns: False > > KeyPress event, serial 23, synthetic NO, window 0xa00001, > root 0x101, subw 0xa00002, time 32795531, (47,57), root:(73,99), > state 0x94, keycode 24 (keysym 0x40, at), same_screen YES, > XLookupString gives 1 bytes: (00) "" > XFilterEvent returns: False > > KeyRelease event, serial 23, synthetic NO, window 0xa00001, > root 0x101, subw 0xa00002, time 32795640, (47,57), root:(73,99), > state 0x94, keycode 24 (keysym 0x40, at), same_screen YES, > XLookupString gives 1 bytes: (00) "" > XFilterEvent returns: False > > KeyRelease event, serial 23, synthetic NO, window 0xa00001, > root 0x101, subw 0xa00002, time 32798390, (47,57), root:(73,99), > state 0x94, keycode 113 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, > XLookupString gives 0 bytes: > XFilterEvent returns: False > > KeyPress event, serial 23, synthetic NO, window 0xa00001, > root 0x101, subw 0xa00002, time 32799890, (47,57), root:(73,99), > state 0x14, keycode 38 (keysym 0x61, a), same_screen YES, > XLookupString gives 1 bytes: (01) "" > XFilterEvent returns: False > > KeyRelease event, serial 23, synthetic NO, window 0xa00001, > root 0x101, subw 0xa00002, time 32800015, (47,57), root:(73,99), > state 0x14, keycode 38 (keysym 0x61, a), same_screen YES, > XLookupString gives 1 bytes: (01) "" > XFilterEvent returns: False > > > The ISO_Level3_Shift without the additional Control_L (left control key) would > be the expected behaviour. > It happens quite often (but I couldn't find the rule behind), pressing the > AltGr ONCE also LOCKS the Control_L key in a way that if you later press a > normal letter, say: a normal c, you get a CONTROL-C into the application. > The Control_L (left control key) stays locked until you press the real CONTROL > key. > > Meanwhile XWin.0.log logs out this: > > [ 32804,781] winSendKeyEvent: dwKey: 105, fDown: 1, nEvents 2 > [ 32805,984] winTranslateKey: wParam 00000011 lParam e01d0001 > [ 32805,984] winSendKeyEvent: dwKey: 29, fDown: 0, nEvents 2 > [ 32805,984] winTranslateKey: wParam 00000012 lParam c1380001 > [ 32805,984] winSendKeyEvent: dwKey: 105, fDown: 0, nEvents 2 > [ 32809,859] winTranslateKey: wParam 00000041 lParam 001e0001 > [ 32809,859] winSendKeyEvent: dwKey: 30, fDown: 1, nEvents 2 > [ 32809,968] winTranslateKey: wParam 00000041 lParam c01e0001 > [ 32809,968] winSendKeyEvent: dwKey: 30, fDown: 0, nEvents 2 > > Key 29 seems to be the stuck control key. > To emphasize again, I didn't press the control key on my keyboard. > I just pressed AltGr Q (in the intention to get a @), released it again, then I > pressed "a". Thanks for the detailed report. The actual issue here is that Windows apparently inserts a fake Ctrl-L keypress/release when AltGr is pressed/released (except when the keyboard layout is US). I have never found any documentation of this behavior, and I've no idea why it does this. There is some code in the X server which attempts to detect and discard these fake keypress/release events, but it not working reliably for some people has been reported a few times, but I've never been able to reproduce the problem or get to the bottom of what causes it. If you are willing to help, I've put together a test build with some extra debugging at [1]. If you could run that with '-logverbose 3' as before and attach the output, that would be helpful. [1] ftp://cygwin.com/pub/cygwinx/XWin.20110801-git-2d9f9305cb559907.exe.bz2 -- Jon TURNEY Volunteer Cygwin/X X Server maintainer -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/