Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Line(s) | |||||
162 | } | 162 | } | ||
163 | 163 | | |||
164 | bool InputEventFilter::swipeGestureCancelled(quint32 time) | 164 | bool InputEventFilter::swipeGestureCancelled(quint32 time) | ||
165 | { | 165 | { | ||
166 | Q_UNUSED(time) | 166 | Q_UNUSED(time) | ||
167 | return false; | 167 | return false; | ||
168 | } | 168 | } | ||
169 | 169 | | |||
170 | bool InputEventFilter::switchEvent(SwitchEvent *event) | ||||
171 | { | ||||
172 | Q_UNUSED(event) | ||||
173 | return false; | ||||
174 | } | ||||
175 | | ||||
170 | void InputEventFilter::passToWaylandServer(QKeyEvent *event) | 176 | void InputEventFilter::passToWaylandServer(QKeyEvent *event) | ||
171 | { | 177 | { | ||
172 | Q_ASSERT(waylandServer()); | 178 | Q_ASSERT(waylandServer()); | ||
173 | if (event->isAutoRepeat()) { | 179 | if (event->isAutoRepeat()) { | ||
174 | return; | 180 | return; | ||
175 | } | 181 | } | ||
176 | switch (event->type()) { | 182 | switch (event->type()) { | ||
177 | case QEvent::KeyPress: | 183 | case QEvent::KeyPress: | ||
▲ Show 20 Lines • Show All 1583 Lines • ▼ Show 20 Line(s) | 1765 | [this] (QPointF orig, QPointF screen, uint32_t time, LibInput::Device *device) { | |||
1761 | m_pointer->processMotion(screen, time, device); | 1767 | m_pointer->processMotion(screen, time, device); | ||
1762 | } | 1768 | } | ||
1763 | ); | 1769 | ); | ||
1764 | connect(conn, &LibInput::Connection::touchDown, m_touch, &TouchInputRedirection::processDown); | 1770 | connect(conn, &LibInput::Connection::touchDown, m_touch, &TouchInputRedirection::processDown); | ||
1765 | connect(conn, &LibInput::Connection::touchUp, m_touch, &TouchInputRedirection::processUp); | 1771 | connect(conn, &LibInput::Connection::touchUp, m_touch, &TouchInputRedirection::processUp); | ||
1766 | connect(conn, &LibInput::Connection::touchMotion, m_touch, &TouchInputRedirection::processMotion); | 1772 | connect(conn, &LibInput::Connection::touchMotion, m_touch, &TouchInputRedirection::processMotion); | ||
1767 | connect(conn, &LibInput::Connection::touchCanceled, m_touch, &TouchInputRedirection::cancel); | 1773 | connect(conn, &LibInput::Connection::touchCanceled, m_touch, &TouchInputRedirection::cancel); | ||
1768 | connect(conn, &LibInput::Connection::touchFrame, m_touch, &TouchInputRedirection::frame); | 1774 | connect(conn, &LibInput::Connection::touchFrame, m_touch, &TouchInputRedirection::frame); | ||
1775 | auto handleSwitchEvent = [this] (SwitchEvent::State state, quint32 time, quint64 timeMicroseconds, LibInput::Device *device) { | ||||
1776 | SwitchEvent event(state, time, timeMicroseconds, device); | ||||
1777 | processSpies(std::bind(&InputEventSpy::switchEvent, std::placeholders::_1, &event)); | ||||
1778 | processFilters(std::bind(&InputEventFilter::switchEvent, std::placeholders::_1, &event)); | ||||
1779 | }; | ||||
1780 | connect(conn, &LibInput::Connection::switchToggledOn, this, | ||||
1781 | std::bind(handleSwitchEvent, SwitchEvent::State::On, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); | ||||
1782 | connect(conn, &LibInput::Connection::switchToggledOff, this, | ||||
1783 | std::bind(handleSwitchEvent, SwitchEvent::State::Off, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); | ||||
1769 | if (screens()) { | 1784 | if (screens()) { | ||
1770 | setupLibInputWithScreens(); | 1785 | setupLibInputWithScreens(); | ||
1771 | } else { | 1786 | } else { | ||
1772 | connect(kwinApp(), &Application::screensCreated, this, &InputRedirection::setupLibInputWithScreens); | 1787 | connect(kwinApp(), &Application::screensCreated, this, &InputRedirection::setupLibInputWithScreens); | ||
1773 | } | 1788 | } | ||
1774 | if (auto s = findSeat()) { | 1789 | if (auto s = findSeat()) { | ||
1775 | // Workaround for QTBUG-54371: if there is no real keyboard Qt doesn't request virtual keyboard | 1790 | // Workaround for QTBUG-54371: if there is no real keyboard Qt doesn't request virtual keyboard | ||
1776 | s->setHasKeyboard(true); | 1791 | s->setHasKeyboard(true); | ||
▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines |