11#include <QtCore/QLoggingCategory>
12#include <QtCore/QSocketNotifier>
13#include <QtCore/private/qcore_unix_p.h>
14#include <private/qguiapplication_p.h>
15#include <private/qinputdevicemanager_p_p.h>
46 if (
buf[
n - 1] ==
'\n')
59 qFatal(
"Failed to get udev context for libinput");
61 m_li = libinput_udev_create_context(&
liInterface,
nullptr, m_udev);
63 qFatal(
"Failed to get libinput context");
66 if (qLcLibInput().isDebugEnabled())
67 libinput_log_set_priority(m_li, LIBINPUT_LOG_PRIORITY_DEBUG);
69 if (
Q_UNLIKELY(libinput_udev_assign_seat(m_li,
"seat0")))
70 qFatal(
"Failed to assign seat");
72 m_liFd = libinput_get_fd(m_li);
101 if (libinput_dispatch(m_li)) {
102 qWarning(
"libinput_dispatch failed");
107 while ((ev = libinput_get_event(m_li)) !=
nullptr) {
109 libinput_event_destroy(ev);
113void QLibInputHandler::processEvent(libinput_event *ev)
115 libinput_event_type
type = libinput_event_get_type(ev);
116 libinput_device *dev = libinput_event_get_device(ev);
119 case LIBINPUT_EVENT_DEVICE_ADDED:
126 if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_TOUCH)) {
132 if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_POINTER)) {
137 if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_KEYBOARD)) {
144 case LIBINPUT_EVENT_DEVICE_REMOVED:
148 if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_TOUCH)) {
154 if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_POINTER)) {
159 if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_KEYBOARD)) {
166 case LIBINPUT_EVENT_POINTER_BUTTON:
167 m_pointer->
processButton(libinput_event_get_pointer_event(ev));
169 case LIBINPUT_EVENT_POINTER_MOTION:
170 m_pointer->
processMotion(libinput_event_get_pointer_event(ev));
172 case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
175#if QT_CONFIG(libinput_hires_wheel_support)
176 case LIBINPUT_EVENT_POINTER_SCROLL_WHEEL:
178 case LIBINPUT_EVENT_POINTER_AXIS:
180 m_pointer->
processAxis(libinput_event_get_pointer_event(ev));
182 case LIBINPUT_EVENT_KEYBOARD_KEY:
183 m_keyboard->
processKey(libinput_event_get_keyboard_event(ev));
185 case LIBINPUT_EVENT_TOUCH_DOWN:
188 case LIBINPUT_EVENT_TOUCH_MOTION:
191 case LIBINPUT_EVENT_TOUCH_UP:
194 case LIBINPUT_EVENT_TOUCH_CANCEL:
197 case LIBINPUT_EVENT_TOUCH_FRAME:
static QInputDeviceManager * inputDeviceManager()
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\inmodule QtCore\reentrant
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent, QPrivateSignal)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
static int qt_safe_open(const char *pathname, int flags, mode_t mode=0777)
static int qt_safe_close(int fd)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void * user_data
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLenum GLenum GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum format
GLsizei const GLchar *const * path
QNetworkAccessManager manager