public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
From: Oliver Schmidt <oschmidt-mailinglists@gmx.de>
To: cygwin-xfree@cygwin.com
Subject: Re: considering modifier keys after gaining focus
Date: Sun, 08 Jan 2012 15:23:00 -0000	[thread overview]
Message-ID: <4F09B4D4.4070905@gmx.de> (raw)
In-Reply-To: <4E4A8D56.6010704@gmx.de>

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

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


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1399 bytes --]

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;


[-- Attachment #3: Type: text/plain, Size: 223 bytes --]

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

  parent reply	other threads:[~2012-01-08 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16 15:31 Oliver Schmidt
2011-08-21  8:44 ` Corinna Vinschen
2011-08-21 10:04   ` Oliver Schmidt
2012-01-08 15:23 ` Oliver Schmidt [this message]
2012-01-09 14:06   ` Jon TURNEY
2012-01-09 18:11     ` Oliver Schmidt
2012-01-10  9:47       ` Oliver Schmidt
2012-01-10 10:15         ` Oliver Schmidt
2012-01-11 17:16       ` Jon TURNEY
2012-01-12 12:19         ` Oliver Schmidt
2012-01-12 12:38           ` Oliver Schmidt

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=4F09B4D4.4070905@gmx.de \
    --to=oschmidt-mailinglists@gmx.de \
    --cc=cygwin-xfree@cygwin.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).