From 32ef6ea3dd6e0ffd8d4c4c05f5283462f7d786e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?okhowang=28=E7=8E=8B=E6=B2=9B=E6=96=87=29?= Date: Tue, 14 Jan 2020 18:03:35 +0800 Subject: [PATCH] support mousex button 8/9 --- common/xrdp_constants.h | 4 ++++ xrdp/xrdp_wm.c | 24 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h index 28a2608e..07d038bb 100644 --- a/common/xrdp_constants.h +++ b/common/xrdp_constants.h @@ -810,6 +810,10 @@ #define WM_BUTTON6DOWN 112 #define WM_BUTTON7UP 113 #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 CB_ITEMCHANGE 300 diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index f68b11e9..eed5f293 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -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); } + 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 */ if (but == 4) @@ -1801,22 +1817,22 @@ xrdp_wm_process_input_mousex(struct xrdp_wm* self, int device_flags, { 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) { - xrdp_wm_mouse_click(self, x, y, 7, 1); + xrdp_wm_mouse_click(self, x, y, 9, 1); } } else { 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) { - xrdp_wm_mouse_click(self, x, y, 7, 0); + xrdp_wm_mouse_click(self, x, y, 9, 0); } } return 0;