From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19364 invoked by alias); 8 Jan 2012 15:23:24 -0000 Received: (qmail 19355 invoked by uid 22791); 8 Jan 2012 15:23:22 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.23) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sun, 08 Jan 2012 15:23:08 +0000 Received: (qmail invoked by alias); 08 Jan 2012 15:23:07 -0000 Received: from p5B08D246.dip0.t-ipconnect.de (EHLO [192.168.178.47]) [91.8.210.70] by mail.gmx.net (mp069) with SMTP; 08 Jan 2012 16:23:07 +0100 Message-ID: <4F09B4D4.4070905@gmx.de> Date: Sun, 08 Jan 2012 15:23:00 -0000 From: Oliver Schmidt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com Subject: Re: considering modifier keys after gaining focus References: <4E4A8D56.6010704@gmx.de> In-Reply-To: <4E4A8D56.6010704@gmx.de> Content-Type: multipart/mixed; boundary="------------070603030404020906040606" X-IsSubscribed: yes 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: 2012-01/txt/msg00001.txt.bz2 --------------070603030404020906040606 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 674 Hi, On 8/16/2011 5:31 PM, Oliver Schmidt wrote: > I had the problem, that the state of the modifier keys was lost when a > window is created (or raised). > I send a patch to fix this problem with this email: I just extended the I just merged the current official source from xorg-server-1.11.3-1 into my local development source and discovered, that my patch for the problem "lost modifier key after a new window is created" has not been applied. Is there a chance, that this patch could be applied to a future version or that another solution could be provided to fix this problem? I'm also attaching a newer version of the patch with this email. Best regards, Oliver --------------070603030404020906040606 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.txt" Content-length: 1399 diff --git a/cygwin/hw/xwin/winkeybd.c b/cygwin/hw/xwin/winkeybd.c index 278342f..a2ac4d0 100644 --- a/cygwin/hw/xwin/winkeybd.c +++ b/cygwin/hw/xwin/winkeybd.c @@ -283,6 +283,29 @@ winRestoreModeKeyStates (void) * have a logical XOR operator, so we use a macro instead. */ + { + /* consider modifer keys */ + + BOOL ctrl = (GetAsyncKeyState (VK_CONTROL) < 0); + BOOL shift = (GetAsyncKeyState (VK_SHIFT) < 0); + BOOL alt = (GetAsyncKeyState (VK_LMENU) < 0); + BOOL altgr = (GetAsyncKeyState (VK_RMENU) < 0); + + if (ctrl && altgr) ctrl = FALSE; + + if (WIN_XOR (internalKeyStates & ControlMask, ctrl)) + winSendKeyEvent (KEY_LCtrl, ctrl); + + if (WIN_XOR (internalKeyStates & ShiftMask, shift)) + winSendKeyEvent (KEY_ShiftL, shift); + + if (WIN_XOR (internalKeyStates & Mod1Mask, alt)) + winSendKeyEvent (KEY_Alt, alt); + + if (WIN_XOR (internalKeyStates & Mod5Mask, altgr)) + winSendKeyEvent (KEY_AltLang, altgr); + } + /* Has the key state changed? */ dwKeyState = GetKeyState (VK_NUMLOCK) & 0x0001; if (WIN_XOR (internalKeyStates & NumLockMask, dwKeyState)) @@ -328,7 +351,7 @@ winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam) MSG msgNext; LONG lTime; Bool fReturn; - + static Bool lastWasControlL = FALSE; static UINT lastMessage; static LONG lastTime; --------------070603030404020906040606 Content-Type: text/plain; charset=us-ascii Content-length: 223 -- 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/ --------------070603030404020906040606--