rpcsx/rpcs3/Emu/Io/Keyboard.cpp
Alexandro Sánchez Bach 4835ae35af Keybord support Added
* Implemented 'cellKb*' functions from 'sys_io' module, which are part
of the libkb library.

* Added corresponding entries in the 'Config > Settings' menu to change
the handler of the keyboard. Supported handlers: Windows, Null.

INFO: This keyboard library is *very* experimental and I am aware of
some bugs. There will be improvements soon.
2013-09-11 22:49:49 +02:00

38 lines
722 B
C++

#include "stdafx.h"
#include "Keyboard.h"
#include "Null/NullKeyboardHandler.h"
#include "Windows/WindowsKeyboardHandler.h"
KeyboardManager::KeyboardManager()
: m_keyboard_handler(nullptr)
, m_inited(false)
{
}
KeyboardManager::~KeyboardManager()
{
}
void KeyboardManager::Init(const u32 max_connect)
{
if(m_inited) return;
switch(Ini.KeyboardHandlerMode.GetValue())
{
case 1: m_keyboard_handler = new WindowsKeyboardHandler(); break;
default:
case 0: m_keyboard_handler = new NullKeyboardHandler(); break;
}
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;
}