mirror of
https://github.com/libretro/Play-.git
synced 2024-12-11 18:54:11 +00:00
linux: configurable controls
This commit is contained in:
parent
7ccfc9f0dd
commit
9f016bd59f
@ -26,6 +26,17 @@ CPH_HidUnix::~CPH_HidUnix()
|
||||
{
|
||||
}
|
||||
|
||||
void CPH_HidUnix::UpdateBinding(BindingPtr* bindarr)
|
||||
{
|
||||
if (bindarr == nullptr) return;
|
||||
for(unsigned int i = 0; i < PS2::CControllerInfo::MAX_BUTTONS; i++)
|
||||
{
|
||||
if (bindarr[i] != 0)
|
||||
m_bindings[i] = bindarr[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CPH_HidUnix::Update(uint8* ram)
|
||||
{
|
||||
for(auto listenerIterator(std::begin(m_listeners));
|
||||
@ -62,32 +73,33 @@ CPadHandler* CPH_HidUnix::PadHandlerFactory(CPH_HidUnix* handler)
|
||||
return handler;
|
||||
}
|
||||
|
||||
void CPH_HidUnix::InputValueCallbackPressed(uint32 valueRef)
|
||||
void CPH_HidUnix::InputValueCallbackPressed(uint32 valueRef, int type)
|
||||
{
|
||||
InputValueCallback(valueRef, 1);
|
||||
InputValueCallback(valueRef, 1, type);
|
||||
}
|
||||
|
||||
void CPH_HidUnix::InputValueCallbackReleased(uint32 valueRef)
|
||||
void CPH_HidUnix::InputValueCallbackReleased(uint32 valueRef, int type)
|
||||
{
|
||||
InputValueCallback(valueRef, 0);
|
||||
InputValueCallback(valueRef, 0, type);
|
||||
}
|
||||
|
||||
void CPH_HidUnix::InputValueCallback(uint32 value, uint32 action)
|
||||
void CPH_HidUnix::InputValueCallback(uint32 value, uint32 action, int type)
|
||||
{
|
||||
for(auto bindingIterator(std::begin(m_bindings));
|
||||
bindingIterator != std::end(m_bindings); bindingIterator++)
|
||||
{
|
||||
const auto& binding = (*bindingIterator);
|
||||
if(!binding) continue;
|
||||
binding->ProcessEvent(value, action);
|
||||
binding->ProcessEvent(value, action, type);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
CPH_HidUnix::CSimpleBinding::CSimpleBinding(uint32 keyCode)
|
||||
CPH_HidUnix::CSimpleBinding::CSimpleBinding(uint32 keyCode, int controllerType)
|
||||
: m_keyCode(keyCode)
|
||||
, m_state(0)
|
||||
, m_controllerType(controllerType)
|
||||
{
|
||||
|
||||
}
|
||||
@ -97,9 +109,9 @@ CPH_HidUnix::CSimpleBinding::~CSimpleBinding()
|
||||
|
||||
}
|
||||
|
||||
void CPH_HidUnix::CSimpleBinding::ProcessEvent(uint32 keyCode, uint32 state)
|
||||
void CPH_HidUnix::CSimpleBinding::ProcessEvent(uint32 keyCode, uint32 state, int controllerType)
|
||||
{
|
||||
if(keyCode != m_keyCode) return;
|
||||
if(keyCode != m_keyCode || controllerType != m_controllerType) return;
|
||||
m_state = state;
|
||||
}
|
||||
|
||||
@ -110,11 +122,12 @@ uint32 CPH_HidUnix::CSimpleBinding::GetValue() const
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
CPH_HidUnix::CSimulatedAxisBinding::CSimulatedAxisBinding(uint32 negativeKeyCode, uint32 positiveKeyCode)
|
||||
CPH_HidUnix::CSimulatedAxisBinding::CSimulatedAxisBinding(uint32 negativeKeyCode, uint32 positiveKeyCode, int controllerType)
|
||||
: m_negativeKeyCode(negativeKeyCode)
|
||||
, m_positiveKeyCode(positiveKeyCode)
|
||||
, m_negativeState(0)
|
||||
, m_positiveState(0)
|
||||
, m_controllerType(controllerType)
|
||||
{
|
||||
|
||||
}
|
||||
@ -124,8 +137,9 @@ CPH_HidUnix::CSimulatedAxisBinding::~CSimulatedAxisBinding()
|
||||
|
||||
}
|
||||
|
||||
void CPH_HidUnix::CSimulatedAxisBinding::ProcessEvent(uint32 keyCode, uint32 state)
|
||||
void CPH_HidUnix::CSimulatedAxisBinding::ProcessEvent(uint32 keyCode, uint32 state, int controllerType)
|
||||
{
|
||||
if(controllerType != m_controllerType) return;
|
||||
if(keyCode == m_negativeKeyCode)
|
||||
{
|
||||
m_negativeState = state;
|
||||
|
@ -13,8 +13,8 @@ public:
|
||||
void Update(uint8*) override;
|
||||
|
||||
static FactoryFunction GetFactoryFunction();
|
||||
void InputValueCallbackPressed(uint32 valueRef);
|
||||
void InputValueCallbackReleased(uint32 valueRef);
|
||||
void InputValueCallbackPressed(uint32 valueRef, int type);
|
||||
void InputValueCallbackReleased(uint32 valueRef, int type);
|
||||
|
||||
private:
|
||||
class CBinding
|
||||
@ -22,35 +22,36 @@ private:
|
||||
public:
|
||||
virtual ~CBinding() {}
|
||||
|
||||
virtual void ProcessEvent(uint32, uint32) = 0;
|
||||
virtual void ProcessEvent(uint32, uint32, int) = 0;
|
||||
|
||||
virtual uint32 GetValue() const = 0;
|
||||
};
|
||||
|
||||
public:
|
||||
typedef std::shared_ptr<CBinding> BindingPtr;
|
||||
|
||||
class CSimpleBinding : public CBinding
|
||||
{
|
||||
public:
|
||||
CSimpleBinding(uint32);
|
||||
CSimpleBinding(uint32, int t = 0);
|
||||
virtual ~CSimpleBinding();
|
||||
|
||||
virtual void ProcessEvent(uint32, uint32);
|
||||
virtual void ProcessEvent(uint32, uint32, int);
|
||||
|
||||
virtual uint32 GetValue() const;
|
||||
|
||||
private:
|
||||
uint32 m_keyCode;
|
||||
uint32 m_state;
|
||||
int m_controllerType;
|
||||
};
|
||||
|
||||
class CSimulatedAxisBinding : public CBinding
|
||||
{
|
||||
public:
|
||||
CSimulatedAxisBinding(uint32, uint32);
|
||||
CSimulatedAxisBinding(uint32, uint32, int = 0);
|
||||
virtual ~CSimulatedAxisBinding();
|
||||
|
||||
virtual void ProcessEvent(uint32, uint32);
|
||||
virtual void ProcessEvent(uint32, uint32, int);
|
||||
|
||||
virtual uint32 GetValue() const;
|
||||
|
||||
@ -60,15 +61,18 @@ private:
|
||||
|
||||
uint32 m_negativeState;
|
||||
uint32 m_positiveState;
|
||||
|
||||
int m_controllerType;
|
||||
};
|
||||
|
||||
static CPadHandler* PadHandlerFactory(CPH_HidUnix*);
|
||||
|
||||
|
||||
void InputValueCallback(uint32 value, uint32 action);
|
||||
void InputValueCallback(uint32 value, uint32 action, int type);
|
||||
|
||||
|
||||
BindingPtr m_bindings[PS2::CControllerInfo::MAX_BUTTONS];
|
||||
void UpdateBinding(BindingPtr *bindarr);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
329
Source/ui_unix/controllerconfigdialog.cpp
Normal file
329
Source/ui_unix/controllerconfigdialog.cpp
Normal file
@ -0,0 +1,329 @@
|
||||
#include "controllerconfigdialog.h"
|
||||
#include "ui_controllerconfigdialog.h"
|
||||
#include "ControllerInfo.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QLabel>
|
||||
#include <QFile>
|
||||
|
||||
#include "AppConfig.h"
|
||||
|
||||
ControllerConfigDialog::ControllerConfigDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ControllerConfigDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
Load(1, ui->tab);
|
||||
ui->tabWidget->removeTab(1);
|
||||
//Load(2, ui->tab_2);
|
||||
}
|
||||
|
||||
ControllerConfigDialog::~ControllerConfigDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ControllerConfigDialog::on_buttonBox_clicked(QAbstractButton *button)
|
||||
{
|
||||
if(button == ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
{
|
||||
Save(1, ui->tab);
|
||||
//Save(2, ui->tab_2);
|
||||
}
|
||||
else if (button == ui->buttonBox->button(QDialogButtonBox::Apply))
|
||||
{
|
||||
Save(ui->tabWidget->currentIndex()+1, ui->tabWidget->currentWidget());
|
||||
}
|
||||
else if (button == ui->buttonBox->button(QDialogButtonBox::RestoreDefaults))
|
||||
{
|
||||
switch (ui->tabWidget->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
foreach (PadQWidgetExt* child, ui->tab->findChildren<PadQWidgetExt *>()) child->restoreDefault();
|
||||
break;
|
||||
case 1:
|
||||
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;
|
||||
}
|
32
Source/ui_unix/controllerconfigdialog.h
Normal file
32
Source/ui_unix/controllerconfigdialog.h
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef CONTROLLERCONFIGDIALOG_H
|
||||
#define CONTROLLERCONFIGDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QAbstractButton>
|
||||
#include <QXmlStreamReader>
|
||||
#include "PH_HidUnix.h"
|
||||
|
||||
namespace Ui {
|
||||
class ControllerConfigDialog;
|
||||
}
|
||||
|
||||
class ControllerConfigDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
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);
|
||||
|
||||
private:
|
||||
void Save(int index, QWidget *tab);
|
||||
void Load(int index, QWidget *tab);
|
||||
Ui::ControllerConfigDialog *ui;
|
||||
};
|
||||
|
||||
#endif // CONTROLLERCONFIGDIALOG_H
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "ui_mainwindow.h"
|
||||
#include "vfsmanagerdialog.h"
|
||||
#include "controllerconfigdialog.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
@ -84,6 +85,9 @@ void MainWindow::initEmu()
|
||||
g_virtualMachine->CreatePadHandler(CPH_HidUnix::GetFactoryFunction());
|
||||
padhandler = static_cast<CPH_HidUnix*>(g_virtualMachine->GetPadHandler());
|
||||
|
||||
CPH_HidUnix::BindingPtr *binding = ControllerConfigDialog::GetBinding(1);
|
||||
padhandler->UpdateBinding(binding);
|
||||
|
||||
StatsManager = new CStatsManager();
|
||||
g_virtualMachine->m_ee->m_gs->OnNewFrame.connect(boost::bind(&CStatsManager::OnNewFrame, StatsManager, _1));
|
||||
|
||||
@ -91,7 +95,6 @@ void MainWindow::initEmu()
|
||||
g_virtualMachine->m_ee->m_os->OnExecutableChange.connect(boost::bind(&MainWindow::OnExecutableChange, this));
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::setOpenGlPanelSize()
|
||||
{
|
||||
openGLWindow_resized();
|
||||
@ -201,13 +204,13 @@ void MainWindow::on_actionExit_triggered()
|
||||
void MainWindow::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (padhandler != nullptr)
|
||||
padhandler->InputValueCallbackPressed(event->key());
|
||||
padhandler->InputValueCallbackPressed(event->key(), 0);
|
||||
}
|
||||
|
||||
void MainWindow::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
if (padhandler != nullptr)
|
||||
padhandler->InputValueCallbackReleased(event->key());
|
||||
padhandler->InputValueCallbackReleased(event->key(), 0);
|
||||
}
|
||||
|
||||
void MainWindow::createStatusBar()
|
||||
@ -439,3 +442,9 @@ void MainWindow::on_actionVFS_Manager_triggered()
|
||||
VFSManagerDialog vfsmgr;
|
||||
vfsmgr.exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionController_Manager_triggered()
|
||||
{
|
||||
ControllerConfigDialog ccd;
|
||||
ccd.exec();
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <QMainWindow>
|
||||
#include <QLabel>
|
||||
#include <QKeyEvent>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "AppConfig.h"
|
||||
#include "PS2VM.h"
|
||||
@ -65,6 +66,7 @@ private:
|
||||
};
|
||||
lastOpenCommand* m_lastOpenCommand = nullptr;
|
||||
|
||||
QString ReadElementValue(QXmlStreamReader &Rxml);
|
||||
protected:
|
||||
void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE;
|
||||
void showEvent(QShowEvent*) Q_DECL_OVERRIDE;
|
||||
@ -90,6 +92,7 @@ private slots:
|
||||
void on_actionReset_triggered();
|
||||
void on_actionMemory_Card_Manager_triggered();
|
||||
void on_actionVFS_Manager_triggered();
|
||||
void on_actionController_Manager_triggered();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
147
Source/ui_unix/padqwidgetext.cpp
Normal file
147
Source/ui_unix/padqwidgetext.cpp
Normal file
@ -0,0 +1,147 @@
|
||||
#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();
|
||||
}
|
64
Source/ui_unix/padqwidgetext.h
Normal file
64
Source/ui_unix/padqwidgetext.h
Normal file
@ -0,0 +1,64 @@
|
||||
#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
|
931
build_unix/controllerconfigdialog.ui
Normal file
931
build_unix/controllerconfigdialog.ui
Normal file
@ -0,0 +1,931 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ControllerConfigDialog</class>
|
||||
<widget class="QDialog" name="ControllerConfigDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>751</width>
|
||||
<height>639</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
|
||||
QGroupBox {
|
||||
border: 1px solid gray;
|
||||
border-radius: 9px;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
||||
QGroupBox::title {
|
||||
subcontrol-origin: margin;
|
||||
left: 10px;
|
||||
padding: 0 3px 0 3px;
|
||||
}
|
||||
|
||||
</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Pad1</string>
|
||||
</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>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<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>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ControllerConfigDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ControllerConfigDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -42,7 +42,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>25</height>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFor_The">
|
||||
@ -61,6 +61,7 @@
|
||||
<addaction name="actionSettings"/>
|
||||
<addaction name="actionMemory_Card_Manager"/>
|
||||
<addaction name="actionVFS_Manager"/>
|
||||
<addaction name="actionController_Manager"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuVirtualMachine">
|
||||
<property name="title">
|
||||
@ -175,6 +176,11 @@
|
||||
<string>VFS Manager...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionController_Manager">
|
||||
<property name="text">
|
||||
<string>Controller Manager...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
@ -13,8 +13,10 @@ DEFINES += PLAY_VERSION=\\\"0.30\\\"
|
||||
VERSION = PLAY_VERSION
|
||||
TEMPLATE = app
|
||||
|
||||
INCLUDEPATH +=../ \
|
||||
INCLUDEPATH +=. \
|
||||
../ \
|
||||
../Source \
|
||||
../Source/ui_unix/ \
|
||||
../../CodeGen/include \
|
||||
../../Framework/include \
|
||||
|
||||
@ -30,8 +32,9 @@ SOURCES += ../Source/ui_unix/main.cpp\
|
||||
../Source/ui_unix/vfsmanagerdialog.cpp \
|
||||
../Source/ui_unix/vfsmodel.cpp \
|
||||
../Source/ui_unix/vfsdiscselectordialog.cpp \
|
||||
../Source/ui_unix/VfsDevice.cpp
|
||||
|
||||
../Source/ui_unix/VfsDevice.cpp \
|
||||
../Source/ui_unix/controllerconfigdialog.cpp \
|
||||
../Source/ui_unix/padqwidgetext.cpp
|
||||
|
||||
|
||||
HEADERS += ../Source/ui_unix/mainwindow.h \
|
||||
@ -46,14 +49,17 @@ HEADERS += ../Source/ui_unix/mainwindow.h \
|
||||
../Source/ui_unix/vfsmanagerdialog.h \
|
||||
../Source/ui_unix/vfsmodel.h \
|
||||
../Source/ui_unix/vfsdiscselectordialog.h \
|
||||
../Source/ui_unix/VfsDevice.h
|
||||
../Source/ui_unix/VfsDevice.h \
|
||||
../Source/ui_unix/controllerconfigdialog.h \
|
||||
../Source/ui_unix/padqwidgetext.h
|
||||
|
||||
|
||||
FORMS += mainwindow.ui \
|
||||
settingsdialog.ui \
|
||||
memorycardmanager.ui \
|
||||
vfsmanagerdialog.ui \
|
||||
vfsdiscselectordialog.ui
|
||||
vfsdiscselectordialog.ui \
|
||||
controllerconfigdialog.ui
|
||||
|
||||
RESOURCES = resources.qrc
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user