48 #include <QWindowSystemInterface> 50 #include <QtGui/private/qpixmap_raster_p.h> 51 #include <QtGui/QPlatformWindow> 56 #ifndef QT_NO_WAYLAND_XKB 57 #include <X11/extensions/XKBcommon.h> 58 #include <X11/keysym.h> 64 , mInputDevice(wl_input_device_create(display, id, 1))
66 , mKeyboardFocus(NULL)
74 #ifndef QT_NO_WAYLAND_XKB 75 struct xkb_rule_names names;
76 names.rules =
"evdev";
77 names.model =
"pc105";
82 mXkb = xkb_compile_keymap_from_rules(&names);
98 int32_t surface_x, int32_t surface_y)
104 if (window == NULL) {
112 inputDevice->
mTime = time;
122 uint32_t time, uint32_t button, uint32_t state)
129 if (window == NULL) {
152 inputDevice->
mButtons &= ~qt_button;
154 inputDevice->
mTime = time;
162 #ifndef QT_NO_WAYLAND_XKB 168 Qt::KeyboardModifiers ret = 0;
169 if (s & XKB_COMMON_SHIFT_MASK)
171 if (s & XKB_COMMON_CONTROL_MASK)
175 if (s & qt_meta_mask)
233 uint32_t time, uint32_t
key, uint32_t state)
235 #ifndef QT_NO_WAYLAND_XKB 239 uint32_t code, sym, level;
240 Qt::KeyboardModifiers modifiers;
244 if (window == NULL) {
250 code = key + inputDevice->
mXkb->min_key_code;
254 XkbKeyGroupWidth(inputDevice->
mXkb, code, 0) > 1)
257 sym = XkbKeySymEntry(inputDevice->
mXkb, code, level, 0);
282 uint32_t time,
struct wl_surface *surface,
283 int32_t x, int32_t y, int32_t sx, int32_t sy)
305 inputDevice->
mTime = time;
311 struct wl_surface *surface,
312 struct wl_array *
keys)
314 #ifndef QT_NO_WAYLAND_XKB 322 end = (uint32_t *) ((
char *) keys->data + keys->size);
324 for (k = (uint32_t *) keys->data; k <
end; k++) {
325 code = *k + inputDevice->
mXkb->min_key_code;
static void handleKeyEvent(QWidget *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
Q_GUI_EXPORT EGLDisplay display()
static void handleWindowActivated(QWidget *w)
static void handleMouseEvent(QWidget *w, const QPoint &local, const QPoint &global, Qt::MouseButtons b)
tlw == 0 means that ev is in global coords only
static const char * data(const QByteArray &arr)
Type
This enum type defines the valid event types in Qt.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
The QPoint class defines a point in the plane using integer precision.
static const KeyPair *const end
static void handleEnterEvent(QWidget *w)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static void handleLeaveEvent(QWidget *w)