mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-02 06:40:05 +01:00
* 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.
38 lines
722 B
C++
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;
|
|
} |