richedit: Typing is ignored while mouse is captured. (retry)

Dylan Smith dylan.ah.smith at gmail.com
Wed Jan 21 09:10:04 CST 2009


I noticed a while ago that on Windows XP richedit controls ignored
characters typed while the mouse is captured (e.g. from holding the left
or middle button down).  Arrow keys, delete, and backspace, copying,
cutting, pasting, and everything else handled on WM_CHAR and WM_KEYDOWN
messages are also ignored.

I tested with builtin riched20 on Windows, and noticed the same problem
in the cases I mentioned above, and this problem was not noticed while
using a native riched20 dll override in Wine.  From this I have
concluded that this is a richedit control problem in this case, since
it is receiving the messages WM_CHAR and WM_KEYDOWN and chooses to
ignore them in these cases.

Perhaps this may be done in a different way for other controls, but for
richedit controls there are less options on how this may be implemented,
since there is not even a handle to the window for this to be done for
windowless richedit controls.  In light of this I am trying again to
correct this behaviour with this updated version of a previous patch I
have sent.
---
 dlls/riched20/editor.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 09f3fb3..33964d6 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2155,6 +2155,8 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
   BOOL ctrl_is_down = GetKeyState(VK_CONTROL) & 0x8000;
   BOOL shift_is_down = GetKeyState(VK_SHIFT) & 0x8000;
 
+  if (editor->bMouseCaptured)
+      return FALSE;
   if (nKey != VK_SHIFT && nKey != VK_CONTROL && nKey != VK_MENU)
       editor->nSelectionType = stPosition;
 
@@ -2400,6 +2402,9 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
 {
   WCHAR wstr;
 
+  if (editor->bMouseCaptured)
+    return 0;
+
   if (unicode)
       wstr = (WCHAR)charCode;
   else


More information about the wine-patches mailing list