diff --git a/input_event.h b/input_event.h index f7a8e52531..548fcfd7f2 100644 --- a/input_event.h +++ b/input_event.h @@ -61,12 +61,21 @@ public: m_modifiersRelevantForShortcuts = mods; } + quint32 nativeButton() const { + return m_nativeButton; + } + + void setNativeButton(quint32 button) { + m_nativeButton = button; + } + private: QSizeF m_delta; QSizeF m_deltaUnccelerated; quint64 m_timestampMicroseconds; LibInput::Device *m_device; Qt::KeyboardModifiers m_modifiersRelevantForShortcuts = Qt::KeyboardModifiers(); + quint32 m_nativeButton = 0; }; class WheelEvent : public QWheelEvent diff --git a/pointer_input.cpp b/pointer_input.cpp index 3fb0719011..66463e4ef3 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -259,6 +259,7 @@ void PointerInputRedirection::processButton(uint32_t button, InputRedirection::P MouseEvent event(type, m_pos, buttonToQtMouseButton(button), m_qtButtons, m_input->keyboardModifiers(), time, QSizeF(), QSizeF(), 0, device); event.setModifiersRelevantForGlobalShortcuts(m_input->modifiersRelevantForGlobalShortcuts()); + event.setNativeButton(button); m_input->processSpies(std::bind(&InputEventSpy::pointerEvent, std::placeholders::_1, &event)); m_input->processFilters(std::bind(&InputEventFilter::pointerEvent, std::placeholders::_1, &event, button));