summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Stockton <rickstockton@reno-computerhelp.com>2012-02-14 18:42:37 -0800
committerJørgen Lind <jorgen.lind@nokia.com>2012-02-15 20:33:25 +0100
commitae6bd13bc0190339d65582bbd3bf82ed1f9985ee (patch)
tree1744b1131a6f1eb077d650c160fcac0bae10e4ed
parentffe7fbfbb5208937394361dabfbf705e3bb2f8fd (diff)
downloadqtwayland-ae6bd13bc0190339d65582bbd3bf82ed1f9985ee.tar.gz
qtwayland: Add support for 16 mouse buttons
Update expands the mouse button assignment code block, which formerly handled only values 272, 273, and 274. New version handles all mouse mouse buttons shown in kernel's input.h header (decimal values 272 through 285). Value 286 appears to be the first button in the range for joystick devices, so I did not include any other kernel-enumerated values. (Other values might be possible- but I don't know of a mouse which is currently being sold with more than 15 non-wheel buttons. The mouse with 15 buttons is the Razer Naga, and I don't own it.) Task-number: QTBUG-22759 Change-Id: I77f16eb89e24d7d6410199badff28c0d48f7df93 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
-rw-r--r--src/plugins/platforms/wayland/qwaylandinputdevice.cpp43
1 files changed, 41 insertions, 2 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
index 88b1bda0..9062ff61 100644
--- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
+++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
@@ -167,8 +167,47 @@ void QWaylandInputDevice::inputHandleButton(void *data,
qt_button = Qt::RightButton;
break;
case 274:
- qt_button = Qt::MiddleButton;
- break;
+ qt_button = Qt::MiddleButton;
+ break;
+ case 275:
+ qt_button = Qt::ExtraButton1; // AKA BackButton
+ break;
+ case 276:
+ qt_button = Qt::ExtraButton2; // AKA ForwardButton
+ break;
+ case 277:
+ qt_button = Qt::ExtraButton3; // AKA TaskButton
+ break;
+ case 278:
+ qt_button = Qt::ExtraButton4;
+ break;
+ case 279:
+ qt_button = Qt::ExtraButton5;
+ break;
+ case 280:
+ qt_button = Qt::ExtraButton6;
+ break;
+ case 281:
+ qt_button = Qt::ExtraButton7;
+ break;
+ case 282:
+ qt_button = Qt::ExtraButton8;
+ break;
+ case 283:
+ qt_button = Qt::ExtraButton9;
+ break;
+ case 284:
+ qt_button = Qt::ExtraButton10;
+ break;
+ case 285:
+ qt_button = Qt::ExtraButton11;
+ break;
+ case 286:
+ qt_button = Qt::ExtraButton12;
+ break;
+ case 285:
+ qt_button = Qt::ExtraButton13;
+ break;
default:
return;
}