Logo
Explore Help
Sign In
izzy/ppsspp
0
0
Fork 0
You've already forked ppsspp
mirror of https://github.com/izzy2lost/ppsspp.git synced 2026-03-10 12:43:04 -07:00
Code Issues Packages Projects Releases Wiki Activity
Files
v0.4
ppsspp/Windows/InputDevice.cpp

14 lines
388 B
C++
Raw Permalink Normal View History

Add a class for keyboard input Removes the windows-specific hack from sceCtrl to read keyboard input and instead add a hack to PPSSPPWindows. The input mapping is still hardcoded and is the same as it was in sceCtrl. Add an std::list to WindowsHost that, curretly, contains a hardcoded list of preferred `InputDevice`s. Devices are tried in-order until one of them reports success. Xinput is preferred over Keyboard. Keyboard always returns success. Pointers are stored in the std::list for polymorphism. Change XinputDevice to report failure as soon as a device can't be queried, instead of only a frame later.
2012-11-12 17:32:35 +00:00
#include "InputDevice.h"
#include "XinputDevice.h"
#include "KeyboardDevice.h"
#include <list>
#include <memory>
#define PUSH_BACK(Cls) do { list.push_back(std::shared_ptr<InputDevice>(new Cls())); } while (0)
std::list<std::shared_ptr<InputDevice>> getInputDevices() {
std::list<std::shared_ptr<InputDevice>> list;
PUSH_BACK(XinputDevice);
PUSH_BACK(KeyboardDevice);
return list;
}
Reference in New Issue Copy Permalink
Powered by Gitea Page: 59ms Template: 4ms
English
English
Licenses API