mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
linux: remove PadQWidgetExt and simplify control config
This commit is contained in:
parent
a57ba6b9bc
commit
f58bd6a5aa
11 changed files with 288 additions and 1322 deletions
102
Source/ui_unix/bindingmodel.cpp
Normal file
102
Source/ui_unix/bindingmodel.cpp
Normal file
|
@ -0,0 +1,102 @@
|
|||
#include "bindingmodel.h"
|
||||
#include "vfsmanagerdialog.h"
|
||||
#include "ControllerInfo.h"
|
||||
#include "AppConfig.h"
|
||||
#include "PH_HidUnix.h"
|
||||
#include "inputeventselectiondialog.h"
|
||||
#include "ControllerInfo.h"
|
||||
|
||||
#define CONFIG_PREFIX ("input")
|
||||
#define CONFIG_BINDING_TYPE ("bindingtype")
|
||||
|
||||
CBindingModel::CBindingModel(QObject *parent)
|
||||
:QAbstractTableModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
CBindingModel::~CBindingModel()
|
||||
{
|
||||
}
|
||||
|
||||
int CBindingModel::rowCount(const QModelIndex & /*parent*/) const
|
||||
{
|
||||
return PS2::CControllerInfo::MAX_BUTTONS;
|
||||
}
|
||||
|
||||
int CBindingModel::columnCount(const QModelIndex & /*parent*/) const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
QVariant CBindingModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
auto binding = m_inputManager->GetBinding(static_cast<PS2::CControllerInfo::BUTTON>(index.row()));
|
||||
if (binding != nullptr)
|
||||
{
|
||||
const char* val = "";
|
||||
switch (index.column())
|
||||
{
|
||||
case 0:
|
||||
val = PS2::CControllerInfo::m_buttonName[index.row()];
|
||||
break;
|
||||
case 1:
|
||||
val = binding->GetBindingTypeName();
|
||||
break;
|
||||
case 2:
|
||||
val = binding->GetDescription().c_str();
|
||||
break;
|
||||
}
|
||||
return QVariant(val);
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void CBindingModel::Setup(CInputBindingManager* inputManager)
|
||||
{
|
||||
m_inputManager = inputManager;
|
||||
}
|
||||
|
||||
bool CBindingModel::setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role)
|
||||
{
|
||||
if (orientation == Qt::Horizontal)
|
||||
{
|
||||
|
||||
if(role == Qt::DisplayRole)
|
||||
{
|
||||
m_h_header.insert(section, value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QAbstractTableModel::setHeaderData(section, orientation, value, role);
|
||||
}
|
||||
|
||||
QVariant CBindingModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (orientation == Qt::Horizontal)
|
||||
{
|
||||
if(role == Qt::DisplayRole)
|
||||
{
|
||||
if (section < m_h_header.size())
|
||||
return m_h_header.at(section);
|
||||
}
|
||||
}
|
||||
|
||||
return QAbstractTableModel::headerData(section, orientation, role);
|
||||
}
|
||||
|
||||
void CBindingModel::DoubleClicked(const QModelIndex &index, QWidget* parent)
|
||||
{
|
||||
|
||||
InputEventSelectionDialog IESD;
|
||||
IESD.Setup(PS2::CControllerInfo::m_buttonName[index.row()], m_inputManager, static_cast<PS2::CControllerInfo::BUTTON>(index.row()));
|
||||
IESD.exec();
|
||||
}
|
||||
|
||||
|
||||
void CBindingModel::Refresh()
|
||||
{
|
||||
QAbstractTableModel::layoutChanged();
|
||||
}
|
30
Source/ui_unix/bindingmodel.h
Normal file
30
Source/ui_unix/bindingmodel.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include "ui_unix/PH_HidUnix.h"
|
||||
|
||||
class CBindingModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CBindingModel(QObject *parent);
|
||||
~CBindingModel();
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
void addData(const QStringList data) const;
|
||||
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
|
||||
void DoubleClicked(const QModelIndex &index, QWidget *parent = 0);
|
||||
void Refresh();
|
||||
|
||||
void Setup(CInputBindingManager*);
|
||||
|
||||
protected:
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
CInputBindingManager* m_inputManager;
|
||||
QVariantList m_h_header;
|
||||
|
||||
};
|
|
@ -5,18 +5,28 @@
|
|||
#include <QRegularExpression>
|
||||
#include <QLabel>
|
||||
#include <QFile>
|
||||
#include <QAbstractButton>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "ui_unix/bindingmodel.h"
|
||||
|
||||
#include "AppConfig.h"
|
||||
|
||||
ControllerConfigDialog::ControllerConfigDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ControllerConfigDialog)
|
||||
ui(new Ui::ControllerConfigDialog),
|
||||
m_inputManager(new CInputBindingManager(CAppConfig::GetInstance()))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
Load(1, ui->tab);
|
||||
ui->tabWidget->removeTab(1);
|
||||
//Load(2, ui->tab_2);
|
||||
CBindingModel* model= new CBindingModel(this);
|
||||
model->Setup(m_inputManager);
|
||||
model->setHeaderData(0, Qt::Orientation::Horizontal, QVariant("Button"), Qt::DisplayRole);
|
||||
model->setHeaderData(1, Qt::Orientation::Horizontal, QVariant("Binding Type"), Qt::DisplayRole);
|
||||
model->setHeaderData(2, Qt::Orientation::Horizontal, QVariant("Binding Value"), Qt::DisplayRole);
|
||||
ui->tableView->setModel(model);
|
||||
ui->tableView->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->tableView->resizeColumnsToContents();
|
||||
}
|
||||
|
||||
ControllerConfigDialog::~ControllerConfigDialog()
|
||||
|
@ -24,306 +34,32 @@ ControllerConfigDialog::~ControllerConfigDialog()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void ControllerConfigDialog::on_tableView_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
static_cast<CBindingModel*>(ui->tableView->model())->DoubleClicked(index, this);
|
||||
}
|
||||
|
||||
void ControllerConfigDialog::on_buttonBox_clicked(QAbstractButton *button)
|
||||
{
|
||||
if(button == ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
{
|
||||
Save(1, ui->tab);
|
||||
//Save(2, ui->tab_2);
|
||||
m_inputManager->Save();
|
||||
}
|
||||
else if (button == ui->buttonBox->button(QDialogButtonBox::Apply))
|
||||
{
|
||||
Save(ui->tabWidget->currentIndex()+1, ui->tabWidget->currentWidget());
|
||||
m_inputManager->Save();
|
||||
}
|
||||
else if (button == ui->buttonBox->button(QDialogButtonBox::RestoreDefaults))
|
||||
{
|
||||
switch (ui->tabWidget->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
foreach (PadQWidgetExt* child, ui->tab->findChildren<PadQWidgetExt *>()) child->restoreDefault();
|
||||
m_inputManager->AutoConfigureKeyboard();
|
||||
static_cast<CBindingModel*>(ui->tableView->model())->Refresh();
|
||||
break;
|
||||
case 1:
|
||||
foreach (PadQWidgetExt* child, ui->tab_2->findChildren<PadQWidgetExt *>()) child->restoreDefault();
|
||||
//foreach (PadQWidgetExt* child, ui->tab_2->findChildren<PadQWidgetExt *>()) child->restoreDefault();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ControllerConfigDialog::Save(int index, QWidget* tab)
|
||||
{
|
||||
|
||||
QMap<QString, PadQWidgetExt*> map;
|
||||
foreach (PadQWidgetExt* child, tab->findChildren<PadQWidgetExt *>())
|
||||
{
|
||||
//Sorted for a more predictable order
|
||||
QString oname (child->objectName());
|
||||
map.insert(oname, child);
|
||||
|
||||
}
|
||||
QString path(CAppConfig::GetBasePath().c_str());
|
||||
QString filename="keymaps_%1.xml";
|
||||
filename = filename.arg(QString::number(index));
|
||||
QFile file(path +"/"+ filename);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
|
||||
xmlWriter.writeStartElement("KeyMaps");
|
||||
for (auto widget = map.begin(); widget != map.end(); ++widget)
|
||||
{
|
||||
PadQWidgetExt* child = widget.value();
|
||||
if (!child->key().isEmpty())
|
||||
{
|
||||
QKeySequence key = child->key();
|
||||
QString oname = child->objectName();
|
||||
int bindingindex = child->bindingIndex();
|
||||
|
||||
xmlWriter.writeStartElement("Key");
|
||||
xmlWriter.writeTextElement("Name", oname);
|
||||
xmlWriter.writeTextElement("BindingIndex", QString::number(bindingindex) );
|
||||
xmlWriter.writeTextElement("Type", QString::number(child->ControlType()));
|
||||
xmlWriter.writeTextElement("Value", QString::number(key[0]));
|
||||
xmlWriter.writeEndElement();
|
||||
|
||||
}
|
||||
}
|
||||
xmlWriter.writeEndElement();
|
||||
file.close();
|
||||
}
|
||||
|
||||
void ControllerConfigDialog::Load(int index, QWidget* tab)
|
||||
{
|
||||
QXmlStreamReader Rxml;
|
||||
QString path(CAppConfig::GetBasePath().c_str());
|
||||
QString filename="keymaps_%1.xml";
|
||||
filename = filename.arg(QString::number(index));
|
||||
QFile file(path +"/"+ filename);
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
foreach (PadQWidgetExt* child, tab->findChildren<PadQWidgetExt *>())
|
||||
child->restoreDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
Rxml.setDevice(&file);
|
||||
Rxml.readNext();
|
||||
|
||||
while(!Rxml.atEnd())
|
||||
{
|
||||
if(Rxml.isStartElement())
|
||||
{
|
||||
if(Rxml.name() == "KeyMaps")
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
else if(Rxml.name() == "Key")
|
||||
{
|
||||
PadQWidgetExt* child = nullptr;
|
||||
while(!Rxml.atEnd())
|
||||
{
|
||||
if(Rxml.isEndElement())
|
||||
{
|
||||
Rxml.readNext();
|
||||
break;
|
||||
}
|
||||
else if(Rxml.isCharacters())
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
else if(Rxml.isStartElement())
|
||||
{
|
||||
if(Rxml.name() == "Name")
|
||||
{
|
||||
QString value = ReadElementValue(Rxml);
|
||||
QRegularExpression re = QRegularExpression(QString("%1").arg(value.toStdString().c_str()).toStdString().c_str());
|
||||
child = tab->findChildren<PadQWidgetExt*>(re).first();
|
||||
if (child == nullptr) break;
|
||||
|
||||
}
|
||||
else if(Rxml.name() == "BindingIndex")
|
||||
{
|
||||
if (child == nullptr) break;
|
||||
int value = ReadElementValue(Rxml).toInt();
|
||||
int bindingindex = child->bindingIndex();
|
||||
if (value != bindingindex) break;
|
||||
}
|
||||
else if(Rxml.name() == "Type")
|
||||
{
|
||||
ReadElementValue(Rxml);
|
||||
}
|
||||
else if(Rxml.name() == "Value")
|
||||
{
|
||||
if (child == nullptr) break;
|
||||
QString value = ReadElementValue(Rxml);
|
||||
QKeySequence key(value.toInt());
|
||||
child->setLabelText(key.toString());
|
||||
child->setkey(key);
|
||||
|
||||
}
|
||||
Rxml.readNext();
|
||||
}
|
||||
else
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
|
||||
if (Rxml.hasError())
|
||||
{
|
||||
fprintf(stderr, "Error: Failed to parse file %s: %s\n", filename.toStdString().c_str() ,file.errorString().toStdString().c_str());
|
||||
}
|
||||
else if (file.error() != QFile::NoError)
|
||||
{
|
||||
fprintf(stderr, "Error: Cannot read file %s: %s\n", filename.toStdString().c_str() ,file.errorString().toStdString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
QString ControllerConfigDialog::ReadElementValue(QXmlStreamReader &Rxml)
|
||||
{
|
||||
while(!Rxml.atEnd())
|
||||
{
|
||||
if(Rxml.isEndElement())
|
||||
{
|
||||
Rxml.readNext();
|
||||
break;
|
||||
}
|
||||
else if(Rxml.isStartElement())
|
||||
{
|
||||
QString value = Rxml.readElementText();
|
||||
return value;
|
||||
break;
|
||||
}
|
||||
else if(Rxml.isCharacters())
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
else
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
CPH_HidUnix::BindingPtr *ControllerConfigDialog::GetBinding(int pad)
|
||||
{
|
||||
uint32 m_axis_bindings[4] = {0};
|
||||
CPH_HidUnix::BindingPtr* m_bindings = new CPH_HidUnix::BindingPtr[PS2::CControllerInfo::MAX_BUTTONS];
|
||||
QXmlStreamReader Rxml;
|
||||
QString path(CAppConfig::GetBasePath().c_str());
|
||||
QString filename="keymaps_%1.xml";
|
||||
filename = filename.arg(QString::number(pad));
|
||||
QFile file(path +"/"+ filename);
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Rxml.setDevice(&file);
|
||||
Rxml.readNext();
|
||||
|
||||
while(!Rxml.atEnd())
|
||||
{
|
||||
if(Rxml.isStartElement())
|
||||
{
|
||||
if(Rxml.name() == "KeyMaps")
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
else if(Rxml.name() == "Key")
|
||||
{
|
||||
QKeySequence key;
|
||||
int bindingindex = -1;
|
||||
int type = 0;
|
||||
while(!Rxml.atEnd())
|
||||
{
|
||||
if(Rxml.isEndElement())
|
||||
{
|
||||
Rxml.readNext();
|
||||
break;
|
||||
}
|
||||
else if(Rxml.isCharacters())
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
else if(Rxml.isStartElement())
|
||||
{
|
||||
if(Rxml.name() == "Name")
|
||||
{
|
||||
ReadElementValue(Rxml);
|
||||
}
|
||||
else if(Rxml.name() == "BindingIndex")
|
||||
{
|
||||
bindingindex = ReadElementValue(Rxml).toInt();
|
||||
}
|
||||
else if(Rxml.name() == "Type")
|
||||
{
|
||||
QString value = ReadElementValue(Rxml);
|
||||
type = value.toInt();
|
||||
|
||||
}
|
||||
else if(Rxml.name() == "Value")
|
||||
{
|
||||
QString value = ReadElementValue(Rxml);
|
||||
key = QKeySequence(value.toInt());
|
||||
|
||||
}
|
||||
Rxml.readNext();
|
||||
}
|
||||
else
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
}
|
||||
if (bindingindex != -1 && !key.isEmpty())
|
||||
{
|
||||
auto currentButtonId = static_cast<PS2::CControllerInfo::BUTTON>(bindingindex);
|
||||
if(PS2::CControllerInfo::IsAxis(currentButtonId)) {
|
||||
if (currentButtonId == PS2::CControllerInfo::ANALOG_LEFT_Y || currentButtonId == PS2::CControllerInfo::ANALOG_RIGHT_Y) {//Invert Up/Down
|
||||
if (m_axis_bindings[bindingindex] == 0)
|
||||
{
|
||||
m_axis_bindings[bindingindex]= key[0];
|
||||
} else {
|
||||
m_bindings[bindingindex] = std::make_shared<CPH_HidUnix::CSimulatedAxisBinding>(key[0], m_axis_bindings[bindingindex], type);
|
||||
}
|
||||
} else {
|
||||
if (m_axis_bindings[bindingindex] == 0)
|
||||
{
|
||||
m_axis_bindings[bindingindex]= key[0];
|
||||
} else {
|
||||
m_bindings[bindingindex] = std::make_shared<CPH_HidUnix::CSimulatedAxisBinding>(m_axis_bindings[bindingindex], key[0]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_bindings[bindingindex] = std::make_shared<CPH_HidUnix::CSimpleBinding>(key[0], type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Rxml.readNext();
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
|
||||
if (Rxml.hasError())
|
||||
{
|
||||
fprintf(stderr, "Error: Failed to parse file %s: %s\n", filename.toStdString().c_str() ,file.errorString().toStdString().c_str());
|
||||
}
|
||||
else if (file.error() != QFile::NoError)
|
||||
{
|
||||
fprintf(stderr, "Error: Cannot read file %s: %s\n", filename.toStdString().c_str() ,file.errorString().toStdString().c_str());
|
||||
}
|
||||
return m_bindings;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,10 @@
|
|||
#include <QDialog>
|
||||
#include <QAbstractButton>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "PH_HidUnix.h"
|
||||
#include "Config.h"
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class ControllerConfigDialog;
|
||||
|
@ -17,15 +20,15 @@ class ControllerConfigDialog : public QDialog
|
|||
public:
|
||||
explicit ControllerConfigDialog(QWidget *parent = 0);
|
||||
~ControllerConfigDialog();
|
||||
static CPH_HidUnix::BindingPtr *GetBinding(int);
|
||||
|
||||
static QString ReadElementValue(QXmlStreamReader &Rxml);
|
||||
|
||||
private slots:
|
||||
void on_buttonBox_clicked(QAbstractButton *button);
|
||||
void on_tableView_doubleClicked(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
void Save(int index, QWidget *tab);
|
||||
void Load(int index, QWidget *tab);
|
||||
CInputBindingManager* m_inputManager;
|
||||
Ui::ControllerConfigDialog *ui;
|
||||
};
|
||||
|
||||
|
|
53
Source/ui_unix/inputeventselectiondialog.cpp
Normal file
53
Source/ui_unix/inputeventselectiondialog.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
#include "inputeventselectiondialog.h"
|
||||
#include "ui_inputeventselectiondialog.h"
|
||||
|
||||
InputEventSelectionDialog::InputEventSelectionDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::InputEventSelectionDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
InputEventSelectionDialog::~InputEventSelectionDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void InputEventSelectionDialog::Setup(const char* text, CInputBindingManager *inputManager, PS2::CControllerInfo::BUTTON button)
|
||||
{
|
||||
m_inputManager = inputManager;
|
||||
ui->label->setText(labeltext.arg(text));
|
||||
m_button = button;
|
||||
|
||||
}
|
||||
void InputEventSelectionDialog::keyPressEvent(QKeyEvent* ev)
|
||||
{
|
||||
if(ev->key() == Qt::Key_Escape) close();
|
||||
|
||||
QString key = QKeySequence(ev->key()).toString();
|
||||
ui->label->setText(ui->label->text() + "\n\nSelected Key: " + key);
|
||||
if(PS2::CControllerInfo::IsAxis(m_button))
|
||||
{
|
||||
if(click_count++ == 0)
|
||||
{
|
||||
m_key1.id = ev->key();
|
||||
m_key1.device = 0;
|
||||
ui->label->setText(ui->label->text() + "\nSimluating Axis, Select Next Key\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
CInputBindingManager::BINDINGINFO m_key2;
|
||||
m_key2.id = ev->key();
|
||||
m_key2.device = 0;
|
||||
m_inputManager->SetSimulatedAxisBinding(m_button, m_key1, m_key2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_key1.id = ev->key();
|
||||
m_key1.device = 0;
|
||||
m_inputManager->SetSimpleBinding(m_button,m_key1);
|
||||
}
|
||||
close();
|
||||
}
|
33
Source/ui_unix/inputeventselectiondialog.h
Normal file
33
Source/ui_unix/inputeventselectiondialog.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "ui_unix/PH_HidUnix.h"
|
||||
|
||||
namespace Ui {
|
||||
class InputEventSelectionDialog;
|
||||
}
|
||||
|
||||
class InputEventSelectionDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InputEventSelectionDialog(QWidget *parent = 0);
|
||||
~InputEventSelectionDialog();
|
||||
|
||||
void Setup(const char*, CInputBindingManager*, PS2::CControllerInfo::BUTTON);
|
||||
|
||||
int click_count = 0;
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QString labeltext = QString("Select new binding for\n%1");
|
||||
PS2::CControllerInfo::BUTTON m_button;
|
||||
CInputBindingManager::BINDINGINFO m_key1;
|
||||
CInputBindingManager *m_inputManager;
|
||||
Ui::InputEventSelectionDialog *ui;
|
||||
};
|
|
@ -1,147 +0,0 @@
|
|||
#include "padqwidgetext.h"
|
||||
#include <QKeyEvent>
|
||||
#include <QLayout>
|
||||
|
||||
PadQWidgetExt::PadQWidgetExt(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setMargin(0);
|
||||
|
||||
|
||||
m_button = new QButtonExt(this);
|
||||
mainLayout->addWidget(m_button) ;
|
||||
|
||||
m_label = new QLabel("Not Mapped", this);
|
||||
m_label->setFrameShape(QFrame::Box);
|
||||
m_label->setFrameShadow(QFrame::Raised);
|
||||
m_label->setLineWidth(2);
|
||||
m_label->setAlignment(Qt::AlignCenter);
|
||||
mainLayout->addWidget(m_label);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
connect(m_button, SIGNAL(pressed()), this, SLOT(clicked()));
|
||||
connect(m_button, SIGNAL(focusout()), this, SLOT(focusout()));
|
||||
|
||||
connect(this, SIGNAL(objectNameChanged(QString)), this, SLOT(setButtonText(QString)));
|
||||
}
|
||||
|
||||
void PadQWidgetExt::clicked(){
|
||||
m_label->setStyleSheet("background: rgb(210, 0, 0);");
|
||||
connect(m_button, SIGNAL(keyDown(QKeyEvent*)),this, SLOT(keyDown(QKeyEvent*)));
|
||||
}
|
||||
|
||||
void PadQWidgetExt::focusout()
|
||||
{
|
||||
m_label->setStyleSheet("");
|
||||
m_key = QKeySequence(m_label->text());
|
||||
disconnect(m_button, SIGNAL(keyDown(QKeyEvent*)), this, SLOT(keyDown(QKeyEvent*)));
|
||||
}
|
||||
|
||||
void PadQWidgetExt::keyDown(QKeyEvent* ev)
|
||||
{
|
||||
Qt::Key ev_key = (Qt::Key)ev->key();
|
||||
if (ev_key == Qt::Key_Escape){
|
||||
QKeySequence seq;
|
||||
if (!m_key.isEmpty())
|
||||
{
|
||||
seq = m_key;
|
||||
}
|
||||
else if (!property("DefaultKey").isNull())
|
||||
{
|
||||
seq = QKeySequence(property("DefaultKey").toString());
|
||||
}
|
||||
m_label->setText(seq.toString());
|
||||
focusout();
|
||||
} else {
|
||||
m_label->setText(QKeySequence(ev_key).toString());
|
||||
}
|
||||
}
|
||||
|
||||
void PadQWidgetExt::setkey(QKeySequence new_key)
|
||||
{
|
||||
m_key = new_key;
|
||||
}
|
||||
|
||||
void PadQWidgetExt::setLabelText(QString text)
|
||||
{
|
||||
m_label->setText(text);
|
||||
}
|
||||
|
||||
void PadQWidgetExt::setButtonText(QString text)
|
||||
{
|
||||
m_button->setText(text.replace("_2","").replace("_","-"));
|
||||
}
|
||||
|
||||
QKeySequence PadQWidgetExt::key()
|
||||
{
|
||||
if (!m_key.isEmpty())
|
||||
{
|
||||
return m_key;
|
||||
}
|
||||
else if (!property("DefaultKey").isNull())
|
||||
{
|
||||
return QKeySequence(property("DefaultKey").toString());
|
||||
}
|
||||
return QKeySequence();
|
||||
}
|
||||
|
||||
PadQWidgetExt::ControllerType PadQWidgetExt::ControlType()
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
int PadQWidgetExt::ControlTypeInt()
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
void PadQWidgetExt::setControlType(int type)
|
||||
{
|
||||
if (m_type == 0 || m_type ==1)
|
||||
{
|
||||
m_type = static_cast<ControllerType>(type);
|
||||
} else {
|
||||
m_type = ControllerType::Keyboard;
|
||||
}
|
||||
}
|
||||
|
||||
int PadQWidgetExt::bindingIndex()
|
||||
{
|
||||
return property("BindingIndex").toInt();
|
||||
}
|
||||
|
||||
void PadQWidgetExt::restoreDefault()
|
||||
{
|
||||
m_key = QKeySequence(property("DefaultKey").toString());
|
||||
if (!m_key.isEmpty())
|
||||
{
|
||||
m_label->setText(m_key.toString());
|
||||
} else {
|
||||
m_label->setText("Not Mapped");
|
||||
}
|
||||
}
|
||||
|
||||
QButtonExt::QButtonExt(QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QButtonExt::~QButtonExt(){}
|
||||
|
||||
void QButtonExt::focusOutEvent(QFocusEvent * ev)
|
||||
{
|
||||
emit focusout();
|
||||
}
|
||||
|
||||
void QButtonExt::keyPressEvent(QKeyEvent* ev)
|
||||
{
|
||||
if (hasFocus())
|
||||
{
|
||||
emit keyDown(ev);
|
||||
}
|
||||
}
|
||||
void QButtonExt::keyReleaseEvent(QKeyEvent* ev)
|
||||
{
|
||||
emit focusout();
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
#ifndef PADQWIDGETEXT_H
|
||||
#define PADQWIDGETEXT_H
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
|
||||
|
||||
class QButtonExt : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QButtonExt(QWidget *parent = Q_NULLPTR);
|
||||
~QButtonExt();
|
||||
|
||||
|
||||
protected:
|
||||
void focusOutEvent(QFocusEvent*) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE;
|
||||
void keyReleaseEvent(QKeyEvent*) Q_DECL_OVERRIDE;
|
||||
|
||||
signals:
|
||||
void focusout();
|
||||
void keyDown(QKeyEvent*);
|
||||
};
|
||||
|
||||
class PadQWidgetExt : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PadQWidgetExt(QWidget *parent = 0);
|
||||
enum ControllerType {
|
||||
Keyboard,
|
||||
GamePad
|
||||
};
|
||||
QKeySequence key();
|
||||
ControllerType ControlType();
|
||||
int bindingIndex();
|
||||
void setkey(QKeySequence);
|
||||
void setLabelText(QString);
|
||||
|
||||
|
||||
void setControlType(int);
|
||||
int ControlTypeInt();
|
||||
void restoreDefault();
|
||||
|
||||
private:
|
||||
ControllerType m_type = Keyboard;
|
||||
QKeySequence m_key;
|
||||
QString m_defaultKey;
|
||||
QButtonExt* m_button;
|
||||
QLabel* m_label;
|
||||
|
||||
private slots:
|
||||
void clicked();
|
||||
void keyDown(QKeyEvent*);
|
||||
void focusout();
|
||||
void setButtonText(QString);
|
||||
|
||||
};
|
||||
|
||||
#endif // PADQWIDGETEXT_H
|
|
@ -598,6 +598,8 @@ if(TARGET_PLATFORM_UNIX)
|
|||
../Source/ui_unix/VfsDevice.cpp
|
||||
../Source/ui_unix/controllerconfigdialog.cpp
|
||||
../Source/ui_unix/InputEventManager.cpp
|
||||
../Source/ui_unix/bindingmodel.cpp
|
||||
../Source/ui_unix/inputeventselectiondialog.cpp
|
||||
)
|
||||
|
||||
set(QT_MOC_HEADERS
|
||||
|
@ -617,6 +619,8 @@ if(TARGET_PLATFORM_UNIX)
|
|||
../Source/ui_unix/VfsDevice.h
|
||||
../Source/ui_unix/controllerconfigdialog.h
|
||||
../Source/ui_unix/InputEventManager.h
|
||||
../Source/ui_unix/bindingmodel.h
|
||||
../Source/ui_unix/inputeventselectiondialog.h
|
||||
)
|
||||
|
||||
set(QT_UIS
|
||||
|
@ -626,6 +630,7 @@ if(TARGET_PLATFORM_UNIX)
|
|||
../build_unix/vfsmanagerdialog.ui
|
||||
../build_unix/vfsdiscselectordialog.ui
|
||||
../build_unix/controllerconfigdialog.ui
|
||||
../build_unix/inputeventselectiondialog.ui
|
||||
)
|
||||
|
||||
set(QT_RESOURCES
|
||||
|
|
|
@ -57,410 +57,7 @@ QGroupBox::title {
|
|||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_1_LS">
|
||||
<property name="title">
|
||||
<string>Left Shoulder Buttons</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="L1" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">E</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="L2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">T</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2_SS">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Select" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Backspace</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Start" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Return</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QGroupBox" name="groupBox_3_RS">
|
||||
<property name="title">
|
||||
<string>Right Shoulder Buttons</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="R1" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>17</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Y</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="R2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>18</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">I</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_4_DPad">
|
||||
<property name="title">
|
||||
<string>Direction-Pad</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Up" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Up</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Right" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Right</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Down" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Down</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Left" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_5_A">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Action Buttons</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Triangle" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">S</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Circle" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">X</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Cross" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>13</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">Z</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Square" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">A</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_6_LA">
|
||||
<property name="title">
|
||||
<string>Left Analog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_10">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_11">
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="L3" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Right" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">G</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Left" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">D</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Down" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">F</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11" stretch="0">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Up" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">R</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_7_LA">
|
||||
<property name="title">
|
||||
<string>Right Analog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_13">
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Up" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">U</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Right" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">K</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Down" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">J</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_19">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Left" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true">H</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="R3" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>19</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QTableView" name="tableView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -468,414 +65,7 @@ QGroupBox::title {
|
|||
<attribute name="title">
|
||||
<string>Pad2</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_14">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_1_LS_2">
|
||||
<property name="title">
|
||||
<string>Left Shoulder Buttons</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_15">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_21">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="L1_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="L2_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2_SS_2">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_16">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Select_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Start_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QGroupBox" name="groupBox_3_RS_2">
|
||||
<property name="title">
|
||||
<string>Right Shoulder Buttons</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_17">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_22">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="R1_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>17</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="R2_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>18</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_4_DPad_2">
|
||||
<property name="title">
|
||||
<string>Direction-Pad</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_18">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_19">
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_23">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Up_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_24">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Right_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_25">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Down_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_26">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="D_Left_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_5_A_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Action Buttons</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_20">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_21">
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_27">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Triangle_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_28">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Circle_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_29">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Cross_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>13</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_30">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="Square_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_6_LA_2">
|
||||
<property name="title">
|
||||
<string>Left Analog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_22">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_23">
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_31" stretch="0">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Up_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_32">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Right_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_33">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Down_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_34">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="LA_Left_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_35">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="L3_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_7_LA_2">
|
||||
<property name="title">
|
||||
<string>Right Analog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_24">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_25">
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_36">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Up_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_37">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Right_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_38">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Down_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_39">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="RA_Left_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_40">
|
||||
<item>
|
||||
<widget class="PadQWidgetExt" name="R3_2" native="true">
|
||||
<property name="BindingIndex" stdset="0">
|
||||
<number>19</number>
|
||||
</property>
|
||||
<property name="DefaultKey" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<layout class="QGridLayout" name="gridLayout_14"/>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -894,14 +84,6 @@ QGroupBox::title {
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>PadQWidgetExt</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>padqwidgetext.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
</tabstops>
|
||||
|
|
33
build_unix/inputeventselectiondialog.ui
Normal file
33
build_unix/inputeventselectiondialog.ui
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InputEventSelectionDialog</class>
|
||||
<widget class="QDialog" name="InputEventSelectionDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>320</width>
|
||||
<height>240</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Select new binding for
|
||||
|
||||
%1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Add table
Add a link
Reference in a new issue