mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-12 22:10:29 +02:00
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.
This commit is contained in:
1 parent
2210b19244
commit
7e7e9a0452
10 files changed
+91
-46
No files matched your search
@@ -40,12 +40,13 @@ int XinputDevice::UpdateState() {
|
||||
__CtrlSetAnalog(left.x, left.y);
|
||||
this->prevState = state;
|
||||
this->check_delay = 0;
|
||||
return 0;
|
||||
} else {
|
||||
// wait check_delay frames before polling the controller again
|
||||
this->gamepad_idx = -1;
|
||||
this->check_delay = 100;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// We only filter the left stick since PSP has no analog triggers or right stick
|
||||
|
||||
Reference in new issue
Block a user