--- /dev/null
+Makefile
+*.o
+multypo
+moc_*.cpp
+*.user
\ No newline at end of file
-#include "multikbd.h"
+#include "multypo.h"
#include <QApplication>
#include <QDebug>
#include <X11/extensions/XInput2.h>
#include <X11/Xutil.h>
-MultiKBD *window;
+MultypoWindow *window;
-class QMyApplication : public QApplication
+class MultypoApplication : public QApplication
{
public:
- QMyApplication(int &argc, char **argv)
+ MultypoApplication(int &argc, char **argv)
: QApplication(argc, argv) {}
virtual bool x11EventFilter ( XEvent * event );
};
-bool QMyApplication::x11EventFilter ( XEvent * event )
+bool MultypoApplication::x11EventFilter ( XEvent * event )
{
if (!window) return false;
return window->handleX11Event(event);
int main(int argc, char *argv[])
{
- QMyApplication a(argc, argv);
- window = new MultiKBD();
+ MultypoApplication a(argc, argv);
+ window = new MultypoWindow();
window->setAttribute(Qt::WA_DeleteOnClose);
window->show();
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MultiKBD</class>
- <widget class="QWidget" name="MultiKBD">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MultiKBD</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QRadioButton" name="radioButton">
- <property name="text">
- <string>RadioButton1</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="radioButton_2">
- <property name="text">
- <string>RadioButton2</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>211</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton">
- <property name="text">
- <string>Close</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources/>
- <connections>
- <connection>
- <sender>pushButton</sender>
- <signal>clicked()</signal>
- <receiver>MultiKBD</receiver>
- <slot>close()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>199</x>
- <y>283</y>
- </hint>
- <hint type="destinationlabel">
- <x>199</x>
- <y>149</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
-#include "multikbd.h"
-#include "ui_multikbd.h"
+#include "multypo.h"
#include <QX11Info>
#include <QDebug>
#include <X11/extensions/XInput2.h>
#include <X11/Xutil.h>
-MultiKBD::MultiKBD(QWidget *parent) :
+MultypoWindow::MultypoWindow(QWidget *parent) :
QWidget(parent),
- ui(new Ui::MultiKBD),
xiInited(false)
{
- ui->setupUi(this);
+
}
-MultiKBD::~MultiKBD()
+MultypoWindow::~MultypoWindow()
{
- delete ui;
}
-void MultiKBD::showEvent ( QShowEvent * )
+void MultypoWindow::showEvent ( QShowEvent * )
{
if (xiInited) return;
setFocus(Qt::OtherFocusReason);*/
}
-void MultiKBD::handleKeyPress(int device, QString string)
+void MultypoWindow::handleKeyPress(int device, QString string)
{
qDebug() << "Device" << device << "String" << string;
}
-bool MultiKBD::handleX11Event(XEvent *event)
+bool MultypoWindow::handleX11Event(XEvent *event)
{
if (!xiInited) return false;
Display *dpy = x11Info().display();
#include <QWidget>
-namespace Ui {
-class MultiKBD;
-}
-
-class MultiKBD : public QWidget
+class MultypoWindow : public QWidget
{
Q_OBJECT
public:
- explicit MultiKBD(QWidget *parent = 0);
- ~MultiKBD();
+ explicit MultypoWindow(QWidget *parent = 0);
+ ~MultypoWindow();
bool handleX11Event(XEvent *event);
void handleKeyPress(int device, QString string);
private:
- Ui::MultiKBD *ui;
bool xiInited;
int xiOpcode;
};
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
-TARGET = multixkbd
+TARGET = multypo
TEMPLATE = app
SOURCES += main.cpp\
- multikbd.cpp
+ multypo.cpp
-HEADERS += multikbd.h
-
-FORMS += multikbd.ui
+HEADERS += multypo.h
LIBS += -lX11 -lXi