> Some of our users have asked if Wine applications could support
> the standard X paste using middle mouse button feature. I'm looking
> for some comments on:
> - whether this would be a good feature

It can't hurt, can it.

> - how hard it would be to implement in Wine

Probably not very. This patch might work
for edit controls, I haven't tested it.

---8<---
Index: wine/controls/edit.c
===================================================================
RCS file: /home/wine/wine/controls/edit.c,v
retrieving revision 1.40
diff -u -u -r1.40 edit.c
--- wine/controls/edit.c        2000/05/05 18:21:02     1.40
+++ wine/controls/edit.c        2000/05/11 19:05:18
@@ -238,6 +238,7 @@
 static LRESULT EDIT_WM_LButtonDblClk(WND *wnd, EDITSTATE *es, DWORD keys,
INT x, INT y);
 static LRESULT EDIT_WM_LButtonDown(WND *wnd, EDITSTATE *es, DWORD keys, INT
x, INT y);
 static LRESULT EDIT_WM_LButtonUp(WND *wnd, EDITSTATE *es, DWORD keys, INT
x, INT y);
+static LRESULT EDIT_WM_MButtonDown(WND *wnd, EDITSTATE *es, DWORD keys, INT
x, INT y);
 static LRESULT EDIT_WM_MouseMove(WND *wnd, EDITSTATE *es, DWORD keys, INT
x, INT y);
 static LRESULT EDIT_WM_NCCreate(WND *wnd, LPCREATESTRUCTA cs);
 static void    EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam);
@@ -805,6 +806,11 @@
                result = EDIT_WM_LButtonUp(wnd, es, (DWORD)wParam,
SLOWORD(lParam), SHIWORD(lParam));
                break;
 
+       case WM_MBUTTONDOWN:
+               DPRINTF_EDIT_MSG32("WM_MBUTTONDOWN");
+               result = EDIT_WM_MButtonDown(wnd, es, (DWORD)wParam,
SLOWORD(lParam), SHIWORD(lParam));
+               break;
+
        case WM_MOUSEACTIVATE:
                /*
                 *      FIXME: maybe DefWindowProc() screws up, but it seems
that
@@ -3574,6 +3580,16 @@
        return 0;
 }
 
+/*********************************************************************
+ *
+ *     WM_MBUTTONDOWN
+ *
+ */
+static LRESULT EDIT_WM_MButtonDown(WND *wnd, EDITSTATE *es, DWORD keys, INT
x, INT y)
+{
+       EDIT_WM_Paste(wnd, es);
+       return 0;
+}
 
 /*********************************************************************
  *
---8<---

Perhaps SendMessage(WM_PASTE) should be used instead,
since it allows applications that overrides WM_PASTE
to work properly, but I think you get the idea.

> - is it is something that should be configurable
>   (e.g. in the winerc file).

I don't think it is nessary if an application
wishes to use the middle mouse button for something
else it can do so without any problem.

Reply via email to