mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 04:39:34 +00:00
Use key mappings in desktop Qt frontend
This commit is contained in:
parent
ea2de859b5
commit
43f78b5d5a
@ -15,6 +15,7 @@
|
||||
#include "Core/Config.h"
|
||||
#include "ConsoleListener.h"
|
||||
#include "base/display.h"
|
||||
#include "base/NKCodeFromQt.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
|
||||
#include "QtHost.h"
|
||||
@ -35,8 +36,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
controls = new Controls(this);
|
||||
|
||||
host = new QtHost(this);
|
||||
emugl = ui->widget;
|
||||
emugl->init(&input_state);
|
||||
@ -89,19 +88,6 @@ void MainWindow::Update()
|
||||
{
|
||||
emugl->updateGL();
|
||||
|
||||
for (int i = 0; i < controllistCount; i++)
|
||||
{
|
||||
if (pressedKeys.contains(controllist[i].key) ||
|
||||
input_state.pad_buttons_down & controllist[i].emu_id)
|
||||
__CtrlButtonDown(controllist[i].psp_id);
|
||||
else
|
||||
__CtrlButtonUp(controllist[i].psp_id);
|
||||
}
|
||||
__CtrlSetAnalogX(clamp1(input_state.pad_lstick_x), 0);
|
||||
__CtrlSetAnalogY(clamp1(input_state.pad_lstick_y), 0);
|
||||
__CtrlSetAnalogX(clamp1(input_state.pad_rstick_x), 1);
|
||||
__CtrlSetAnalogY(clamp1(input_state.pad_rstick_y), 1);
|
||||
|
||||
if (lastUIState != globalUIState) {
|
||||
lastUIState = globalUIState;
|
||||
UpdateMenus();
|
||||
@ -197,12 +183,12 @@ void MainWindow::keyPressEvent(QKeyEvent *e)
|
||||
return;
|
||||
}
|
||||
|
||||
pressedKeys.insert(e->key());
|
||||
NativeKey(KeyInput(DEVICE_ID_KEYBOARD, KeyMapRawQttoNative.find(e->key())->second, KEY_DOWN));
|
||||
}
|
||||
|
||||
void MainWindow::keyReleaseEvent(QKeyEvent *e)
|
||||
{
|
||||
pressedKeys.remove(e->key());
|
||||
NativeKey(KeyInput(DEVICE_ID_KEYBOARD, KeyMapRawQttoNative.find(e->key())->second, KEY_UP));
|
||||
}
|
||||
|
||||
/* SLOTS */
|
||||
@ -452,11 +438,6 @@ void MainWindow::on_action_OptionsIgnoreIllegalReadsWrites_triggered()
|
||||
UpdateMenus();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_OptionsControls_triggered()
|
||||
{
|
||||
controls->show();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_AFOff_triggered()
|
||||
{
|
||||
g_Config.iAnisotropyLevel = 0;
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "debugger_memory.h"
|
||||
#include "debugger_memorytex.h"
|
||||
#include "debugger_displaylist.h"
|
||||
#include "controls.h"
|
||||
|
||||
class QtEmuGL;
|
||||
namespace Ui {
|
||||
@ -79,9 +78,6 @@ private slots:
|
||||
void on_action_OptionsFastMemory_triggered();
|
||||
void on_action_OptionsIgnoreIllegalReadsWrites_triggered();
|
||||
|
||||
// Controls
|
||||
void on_action_OptionsControls_triggered();
|
||||
|
||||
// Video
|
||||
void on_action_AFOff_triggered();
|
||||
void on_action_AF2x_triggered();
|
||||
@ -155,9 +151,6 @@ private:
|
||||
Debugger_Memory *memoryWindow;
|
||||
Debugger_MemoryTex *memoryTexWindow;
|
||||
Debugger_DisplayList *displaylistWindow;
|
||||
Controls *controls;
|
||||
|
||||
QSet<int> pressedKeys;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
@ -178,12 +178,6 @@
|
||||
<addaction name="action_OptionsDisplayRawFramebuffer"/>
|
||||
<addaction name="actionFrameskip"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuControls">
|
||||
<property name="title">
|
||||
<string>Co&ntrols</string>
|
||||
</property>
|
||||
<addaction name="action_OptionsControls"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuCore">
|
||||
<property name="title">
|
||||
<string>&Core</string>
|
||||
@ -196,7 +190,6 @@
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<addaction name="menuCore"/>
|
||||
<addaction name="menuControls"/>
|
||||
<addaction name="menuVideo"/>
|
||||
<addaction name="action_Sound"/>
|
||||
<addaction name="separator"/>
|
||||
@ -357,11 +350,6 @@
|
||||
<string>Ctrl+M</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_OptionsControls">
|
||||
<property name="text">
|
||||
<string>&Keyboard</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_OptionsFullScreen">
|
||||
<property name="text">
|
||||
<string>&Toggle fullscreen</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user