Add KeyDialog class
This will take care of reading user input. TODO: Correct mouse buttons values, they do not match Xtest values.
This commit is contained in:
27
src/keydialog.hpp
Normal file
27
src/keydialog.hpp
Normal file
@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <QString>
|
||||
#include <QLabel>
|
||||
#include <QKeyEvent>
|
||||
#include <QMouseEvent>
|
||||
|
||||
class KeyDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
bool m_acceptMouse;
|
||||
QLabel m_text;
|
||||
|
||||
bool m_isMouse;
|
||||
quint32 m_value;
|
||||
|
||||
KeyDialog( const QString& button, bool m = false, QWidget* parent = 0 );
|
||||
void keyPressEvent( QKeyEvent* );
|
||||
void keyReleaseEvent( QKeyEvent* );
|
||||
void mouseReleaseEvent( QMouseEvent* );
|
||||
|
||||
public:
|
||||
static int getKey( const QString& button, bool acceptMouse = false, bool* mousePressed = 0, QWidget* parent = 0 );
|
||||
|
||||
};
|
Reference in New Issue
Block a user