In System.Windows.Forms:
authorGeoff Norton <grompf@sublimeintervention.com>
Mon, 4 Feb 2008 22:32:56 +0000 (22:32 -0000)
committerGeoff Norton <grompf@sublimeintervention.com>
Mon, 4 Feb 2008 22:32:56 +0000 (22:32 -0000)
2008-02-04  Geoff Norton  <gnorton@novell.com>

* X11Keyboard.cs: VK_MENU should send a KEYUP instead of
SYSKEYUP if any other key has been pressed in the mean time.
Fixes #324404

svn path=/trunk/mcs/; revision=94804

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs

index f63b0efffff423c7a4171b7096cca1ad220af916..68943c482a45bfc948af82d9fbe61113561dfaa7 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-04  Geoff Norton  <gnorton@novell.com>
+
+       * X11Keyboard.cs: VK_MENU should send a KEYUP instead of 
+       SYSKEYUP if any other key has been pressed in the mean time.
+       Fixes #324404
+
 2008-02-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * ListView.cs: In ItemControl.ItemsMouseMove, only fire ItemDrag event
index 5ea0fd734a4b3c1951b31656cb794f49f10f0d0c..f4fc2e77002d204b2ff8bb86211caa7facf5ca36 100644 (file)
@@ -51,6 +51,7 @@ namespace System.Windows.Forms {
                private int lcid;
                private bool num_state, cap_state;
                private bool initialized;
+               private bool menu_state = false;
 
                private int NumLockMask;
                private int AltGrMask;
@@ -205,9 +206,17 @@ namespace System.Windows.Forms {
                        if (msg.message >= Msg.WM_KEYFIRST && msg.message <= Msg.WM_KEYLAST)
                                res = true;
 
+                       if (msg.message == Msg.WM_SYSKEYUP && msg.wParam == (IntPtr) 0x12 && menu_state) {
+                               msg.message = Msg.WM_KEYUP;
+                               menu_state = false;
+                       }
+
                        if (msg.message != Msg.WM_KEYDOWN && msg.message != Msg.WM_SYSKEYDOWN)
                                return res;
 
+                       if ((key_state_table [(int) VirtualKeys.VK_MENU] & 0x80) != 0 && msg.wParam != (IntPtr) 0x12)
+                               menu_state = true;
+
                        EnsureLayoutInitialized ();
 
                        string buffer;