mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
Input: avoid exception while no keyboard is registered
This commit is contained in:
parent
1046184dd0
commit
d6664450df
@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include "Utilities/mutex.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Emu/Io/KeyboardHandler.h"
|
||||
|
||||
@ -10,7 +10,7 @@ public:
|
||||
memset(&m_info, 0, sizeof(KbInfo));
|
||||
m_info.max_connect = max_connect;
|
||||
m_keyboards.clear();
|
||||
for(u32 i=0; i<max_connect; i++)
|
||||
for (u32 i = 0; i < max_connect; i++)
|
||||
{
|
||||
m_keyboards.emplace_back(Keyboard());
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Emu/Io/MouseHandler.h"
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Emu/Io/PadHandler.h"
|
||||
|
||||
|
@ -79,7 +79,7 @@ void basic_keyboard_handler::keyPressEvent(QKeyEvent* keyEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
if (keyEvent->isAutoRepeat() && !m_keyboards[0].m_key_repeat)
|
||||
if (m_keyboards.empty() || (keyEvent->isAutoRepeat() && !m_keyboards[0].m_key_repeat))
|
||||
{
|
||||
keyEvent->ignore();
|
||||
return;
|
||||
@ -100,7 +100,7 @@ void basic_keyboard_handler::keyReleaseEvent(QKeyEvent* keyEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
if (keyEvent->isAutoRepeat() && !m_keyboards[0].m_key_repeat)
|
||||
if (m_keyboards.empty() || (keyEvent->isAutoRepeat() && !m_keyboards[0].m_key_repeat))
|
||||
{
|
||||
keyEvent->ignore();
|
||||
return;
|
||||
@ -153,6 +153,11 @@ s32 basic_keyboard_handler::getUnmodifiedKey(QKeyEvent* keyEvent)
|
||||
|
||||
void basic_keyboard_handler::LoadSettings()
|
||||
{
|
||||
if (m_keyboards.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Meta Keys
|
||||
//m_keyboards[0].m_buttons.emplace_back(Qt::Key_Control, CELL_KB_MKEY_L_CTRL);
|
||||
m_keyboards[0].m_buttons.emplace_back(Qt::Key_Shift, CELL_KB_MKEY_L_SHIFT);
|
||||
|
@ -36,7 +36,7 @@ private:
|
||||
std::shared_ptr<gui_settings> m_gui_settings;
|
||||
|
||||
u64 m_frames = 0;
|
||||
// display status of last title update
|
||||
// display status of last title update, needed for dynamic changes of the fps setting
|
||||
bool m_show_fps_in_title = false;
|
||||
QString m_windowTitle;
|
||||
bool m_disable_mouse;
|
||||
|
Loading…
x
Reference in New Issue
Block a user