#include <QX11Info>
#include <QDebug>
+#include <QHBoxLayout>
+#include <QLabel>
#include <X11/Xlib.h>
#include <X11/extensions/XInput2.h>
QWidget(parent),
xiInited(false)
{
-
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ setLayout(layout);
+
+ mainLabel = new QLabel(this);
+ layout->addWidget(mainLabel);
+
+ setMinimumSize(300, 300);
}
MultypoWindow::~MultypoWindow()
XISelectEvents (dpy, winId(), &eventmask, 1);
xiInited = true;
-
- /*activateWindow();
- raise();
- setFocus(Qt::OtherFocusReason);*/
}
void MultypoWindow::handleKeyPress(int device, QString string)
{
qDebug() << "Device" << device << "String" << string;
+ mainLabel->setText(QString("%1 pressed on %2").arg(string).arg(device));
}
bool MultypoWindow::handleX11Event(XEvent *event)