Atsushi Eno wrote:
Hello,

Doug Rintoul wrote:
Atsushi Eno wrote:
Thanks for the details. Though I don't think I completely understand the second issue (XIM event order matter), I am persuaded. Your patch is in svn (along with my patch
of course too).

Thanks for this. I am assuming that only the patch for the second problem is committed. Any thoughts on solving the tracking of the modification keys (control, alt, shift, etc)?
Now I could go ahead and came to this issue. I have created a
patch to control those key states (which are in X11Keyboard)
*before* calling XFilterEvent(). I guess it would work as every
key press/release events are handled regardless of filter and
press/release state for non-shift key is used only to flag key
input state (possibly in no use).

With this patch, my present issue (atok x3 / iiimx loses shift state when it is enabled) went away.

If you have some time, please have a look at the patch. I'd like to hear your feedback :)

Atsushi Eno

Hi Atsushi,

I tried to apply your patch against the current svn but had one reject. It seems that a part of this patch is already in svn. Attached is the reject file. What version should I be applying your patch to?

Doug Rintoul.
***************
*** 1561,1578 ****
  
                                        XNextEvent (DisplayHandle, ref xevent);
  
-                                       if (xevent.AnyEvent.type == 
XEventName.KeyPress) {
                                                if (XFilterEvent(ref xevent, 
FosterParent)) {
                                                        // probably here we 
could raise WM_IME_KEYDOWN and
                                                        // WM_IME_KEYUP, but 
I'm not sure it is worthy.
                                                        continue;
                                                }
                                        }
-                                       else if (xevent.AnyEvent.type == 
XEventName.KeyRelease)
-                                               // Allow the Input Method to 
process key releases but also pass them on to the
-                                               // keyboard event processing 
because certain states (Shift, Control) are not 
-                                               // correctly if we don't.       
                                             
-                                               XFilterEvent(ref xevent, 
FosterParent);
                                        else if (XFilterEvent (ref xevent, 
IntPtr.Zero))
                                                continue;
                                }
--- 1568,1583 ----
  
                                        XNextEvent (DisplayHandle, ref xevent);
  
+                                       if (xevent.AnyEvent.type == 
XEventName.KeyPress ||
+                                           xevent.AnyEvent.type == 
XEventName.KeyRelease) {
+                                               // PreFilter() handles "shift 
key state updates.
+                                               Keyboard.PreFilter (xevent);
                                                if (XFilterEvent(ref xevent, 
FosterParent)) {
                                                        // probably here we 
could raise WM_IME_KEYDOWN and
                                                        // WM_IME_KEYUP, but 
I'm not sure it is worthy.
                                                        continue;
                                                }
                                        }
                                        else if (XFilterEvent (ref xevent, 
IntPtr.Zero))
                                                continue;
                                }
_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to