mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
* use one central unified log with channels/priorities ad-hoc listener registration and de-registration * disable buffering by default * add multi-threaded ringbuffer implementation * use buffered listener for the gui (using the ringbuffer)
41 lines
No EOL
871 B
C++
41 lines
No EOL
871 B
C++
#include "stdafx.h"
|
|
#include "Utilities/Log.h"
|
|
#include "rpcs3/Ini.h"
|
|
#include "Keyboard.h"
|
|
#include "Null/NullKeyboardHandler.h"
|
|
|
|
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 = rPlatform::getKeyboardHandlerCount();
|
|
int selectedHandler = Ini.KeyboardHandlerMode.GetValue();
|
|
if (selectedHandler > numHandlers)
|
|
{
|
|
selectedHandler = 0;
|
|
}
|
|
m_keyboard_handler.reset(rPlatform::getKeyboardHandler(selectedHandler));
|
|
|
|
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;
|
|
} |