mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 23:15:18 +00:00
Some things improved
shared_mutex_t implemented GUI Emu Callbacks rewritten fxm::import, fxm::import_always implemented cellMsgDialog rewritten Emu.CallAfter improved (returns std::future)
This commit is contained in:
parent
9d68c16c62
commit
8ae3401ffa
77 changed files with 1814 additions and 1831 deletions
|
|
@ -1,60 +1,15 @@
|
|||
#include "stdafx.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
#include "Null/NullKeyboardHandler.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include "Keyboard.h"
|
||||
|
||||
GetKeyboardHandlerCountCb GetKeyboardHandlerCount = []()
|
||||
void KeyboardManager::Init(u32 max_connect)
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
GetKeyboardHandlerCb GetKeyboardHandler = [](int i) -> KeyboardHandlerBase*
|
||||
{
|
||||
return new NullKeyboardHandler;
|
||||
};
|
||||
|
||||
void SetGetKeyboardHandlerCountCallback(GetKeyboardHandlerCountCb cb)
|
||||
{
|
||||
GetKeyboardHandlerCount = cb;
|
||||
}
|
||||
|
||||
void SetGetKeyboardHandlerCallback(GetKeyboardHandlerCb cb)
|
||||
{
|
||||
GetKeyboardHandler = cb;
|
||||
}
|
||||
|
||||
KeyboardManager::KeyboardManager()
|
||||
: m_keyboard_handler(nullptr)
|
||||
, m_inited(false)
|
||||
{
|
||||
}
|
||||
|
||||
KeyboardManager::~KeyboardManager()
|
||||
{
|
||||
}
|
||||
|
||||
void KeyboardManager::Init(const u32 max_connect)
|
||||
{
|
||||
if(m_inited)
|
||||
return;
|
||||
|
||||
// NOTE: Change these to std::make_unique assignments when C++14 comes out.
|
||||
int numHandlers = GetKeyboardHandlerCount();
|
||||
int selectedHandler = Ini.KeyboardHandlerMode.GetValue();
|
||||
if (selectedHandler > numHandlers)
|
||||
{
|
||||
selectedHandler = 0;
|
||||
}
|
||||
m_keyboard_handler.reset(GetKeyboardHandler(selectedHandler));
|
||||
|
||||
m_keyboard_handler = Emu.GetCallbacks().get_kb_handler();
|
||||
m_keyboard_handler->Init(max_connect);
|
||||
m_inited = true;
|
||||
}
|
||||
|
||||
void KeyboardManager::Close()
|
||||
{
|
||||
if(m_keyboard_handler) m_keyboard_handler->Close();
|
||||
m_keyboard_handler = nullptr;
|
||||
|
||||
m_inited = false;
|
||||
m_keyboard_handler.reset();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue