diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-10 14:23:54 +0300 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-10 19:15:04 +0200 |
commit | e0054c0b6dd9f2a30f1195f8fd13426f2b358f57 (patch) | |
tree | 6f6eb22c8df72b6bd2c75fc0b0d1ea22b62606ef /src/compositor/wayland_wrapper/wlinputdevice.cpp | |
parent | 9bf1e7ddce29dd2d84d514b37c87fe7f9adc5b63 (diff) |
Add wheel event support
Change-Id: Id827485138758ccb4c0db420559b2b9af5c45bbc
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/wlinputdevice.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/wlinputdevice.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/wlinputdevice.cpp b/src/compositor/wayland_wrapper/wlinputdevice.cpp index 9fc120bd4..4bbf0dd38 100644 --- a/src/compositor/wayland_wrapper/wlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/wlinputdevice.cpp @@ -104,6 +104,17 @@ void InputDevice::sendMouseMoveEvent(Surface *surface, const QPointF &localPos, sendMouseMoveEvent(localPos,globalPos); } +void InputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta) +{ + struct wl_resource *resource = base()->pointer_focus_resource; + if (!resource) + return; + uint32_t time = m_compositor->currentTimeMsecs(); + uint32_t axis = orientation == Qt::Horizontal ? WL_INPUT_DEVICE_AXIS_HORIZONTAL_SCROLL + : WL_INPUT_DEVICE_AXIS_VERTICAL_SCROLL; + wl_input_device_send_axis(resource, time, axis, delta); +} + void InputDevice::sendKeyPressEvent(uint code) { if (base()->keyboard_focus_resource != NULL) { |