Merge pull request #1478 from okhowang/devel

support mousex button 8/9
This commit is contained in:
metalefty 2020-01-16 09:29:10 +09:00 committed by GitHub
commit 7ac90b77aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 4 deletions

View File

@ -810,6 +810,10 @@
#define WM_BUTTON6DOWN 112 #define WM_BUTTON6DOWN 112
#define WM_BUTTON7UP 113 #define WM_BUTTON7UP 113
#define WM_BUTTON7DOWN 114 #define WM_BUTTON7DOWN 114
#define WM_BUTTON8UP 115
#define WM_BUTTON8DOWN 116
#define WM_BUTTON9UP 117
#define WM_BUTTON9DOWN 118
#define WM_INVALIDATE 200 #define WM_INVALIDATE 200
#define CB_ITEMCHANGE 300 #define CB_ITEMCHANGE 300

View File

@ -1339,6 +1339,22 @@ xrdp_wm_mouse_click(struct xrdp_wm *self, int x, int y, int but, int down)
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON3UP, x, y, 0, 0); self->mm->mod->mod_event(self->mm->mod, WM_BUTTON3UP, x, y, 0, 0);
} }
if (but == 8 && down)
{
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON8DOWN, x, y, 0, 0);
}
else if (but == 8 && !down)
{
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON8UP, x, y, 0, 0);
}
if (but == 9 && down)
{
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON9DOWN, x, y, 0, 0);
}
else if (but == 9 && !down)
{
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON9UP, x, y, 0, 0);
}
/* vertical scroll */ /* vertical scroll */
if (but == 4) if (but == 4)
@ -1801,22 +1817,22 @@ xrdp_wm_process_input_mousex(struct xrdp_wm* self, int device_flags,
{ {
if (device_flags & PTRXFLAGS_BUTTON1) if (device_flags & PTRXFLAGS_BUTTON1)
{ {
xrdp_wm_mouse_click(self, x, y, 6, 1); xrdp_wm_mouse_click(self, x, y, 8, 1);
} }
else if (device_flags & PTRXFLAGS_BUTTON2) else if (device_flags & PTRXFLAGS_BUTTON2)
{ {
xrdp_wm_mouse_click(self, x, y, 7, 1); xrdp_wm_mouse_click(self, x, y, 9, 1);
} }
} }
else else
{ {
if (device_flags & PTRXFLAGS_BUTTON1) if (device_flags & PTRXFLAGS_BUTTON1)
{ {
xrdp_wm_mouse_click(self, x, y, 6, 0); xrdp_wm_mouse_click(self, x, y, 8, 0);
} }
else if (device_flags & PTRXFLAGS_BUTTON2) else if (device_flags & PTRXFLAGS_BUTTON2)
{ {
xrdp_wm_mouse_click(self, x, y, 7, 0); xrdp_wm_mouse_click(self, x, y, 9, 0);
} }
} }
return 0; return 0;