diff options
Diffstat (limited to 'unix/xserver')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 2 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.h | 2 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/vncInput.c | 19 |
3 files changed, 20 insertions, 3 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index e3bc57d8..328b0886 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -463,7 +463,7 @@ void XserverDesktop::terminate() kill(getpid(), SIGTERM); } -void XserverDesktop::pointerEvent(const Point& pos, uint8_t buttonMask) +void XserverDesktop::pointerEvent(const Point& pos, uint16_t buttonMask) { vncPointerMove(pos.x + vncGetScreenX(screenIndex), pos.y + vncGetScreenY(screenIndex)); diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h index d287b72f..8c543db7 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.h +++ b/unix/xserver/hw/vnc/XserverDesktop.h @@ -95,7 +95,7 @@ public: void terminate() override; void queryConnection(network::Socket* sock, const char* userName) override; - void pointerEvent(const rfb::Point& pos, uint8_t buttonMask) override; + void pointerEvent(const rfb::Point& pos, uint16_t buttonMask) override; void keyEvent(uint32_t keysym, uint32_t keycode, bool down) override; unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet& layout) override; diff --git a/unix/xserver/hw/vnc/vncInput.c b/unix/xserver/hw/vnc/vncInput.c index 1de41430..a705a85a 100644 --- a/unix/xserver/hw/vnc/vncInput.c +++ b/unix/xserver/hw/vnc/vncInput.c @@ -50,7 +50,7 @@ extern const unsigned int code_map_qnum_to_xorgevdev_len; extern const unsigned short code_map_qnum_to_xorgkbd[]; extern const unsigned int code_map_qnum_to_xorgkbd_len; -#define BUTTONS 7 +#define BUTTONS 9 DeviceIntPtr vncKeyboardDev; DeviceIntPtr vncPointerDev; @@ -207,6 +207,23 @@ static int vncPointerProc(DeviceIntPtr pDevice, int onoff) btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); + /* + * The labels BTN_LABEL_PROP_BTN_SIDE and BTN_LABEL_PROP_BTN_EXTRA + * represent the side buttons on mice that are typically used to + * navigate back/forward respectively in web browsers. + * + * In X11, these labels are mapped to the BTN_SIDE and BTN_EXTRA + * input codes, which are mapped in the Linux HID driver. These + * are not to be confused with the BTN_FORWARD and BTN_BACK input + * codes, which some applications also use for back/forward + * navigation. + * + * It seems like most mice have their side buttons mapped to + * BTN_SIDE and BTN_EXTRA. + */ + btn_labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_SIDE); + btn_labels[8] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_EXTRA); + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); |