mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Make both modern and legacy key mapping input work
This commit is contained in:
parent
20399b9d6c
commit
770456156d
2 changed files with 7 additions and 22 deletions
|
@ -192,17 +192,10 @@ void EmuScreen::update(InputState &input) {
|
|||
}
|
||||
#endif
|
||||
|
||||
// Daniel:
|
||||
// Sorry I know it is pretensious of me to
|
||||
// ask platforms to define a "legacy" def
|
||||
// just becasue I am changing things on
|
||||
// other platforms.
|
||||
// Please be patient with me, I will try
|
||||
// to migrate other platforms as time goes
|
||||
// on.
|
||||
// TODO: Migrate all platforms to "modern"
|
||||
// key mapping
|
||||
#ifdef LEGACY_KEY_MAPPING
|
||||
// Set Keys ----
|
||||
__CtrlButtonUp(-1); // blanks all buttons
|
||||
uint32_t pressed = 0;
|
||||
|
||||
// Legacy key mapping
|
||||
// Then translate pad input into PSP pad input. Also, add in tilt.
|
||||
static const int mapping[12][2] = {
|
||||
|
@ -221,18 +214,10 @@ void EmuScreen::update(InputState &input) {
|
|||
};
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
if (input.pad_buttons_down & mapping[i][0]) {
|
||||
__CtrlButtonDown(mapping[i][1]);
|
||||
}
|
||||
if (input.pad_buttons_up & mapping[i][0]) {
|
||||
__CtrlButtonUp(mapping[i][1]);
|
||||
}
|
||||
pressed |= input.pad_buttons_down & mapping[i][0];
|
||||
}
|
||||
|
||||
#else
|
||||
// Modern key mapping
|
||||
__CtrlButtonUp(-1); // blanks all buttons
|
||||
uint32_t pressed = 0;
|
||||
for (int i = 0; i < MAX_KEYQUEUESIZE; i++) {
|
||||
int key = input.key_queue[i];
|
||||
if (key == 0)
|
||||
|
@ -242,7 +227,7 @@ void EmuScreen::update(InputState &input) {
|
|||
pressed |= KeyMap::KeyToPspButton(key);
|
||||
}
|
||||
__CtrlButtonDown(pressed);
|
||||
#endif
|
||||
// End Set Keys --
|
||||
|
||||
float stick_x = input.pad_lstick_x;
|
||||
float stick_y = input.pad_lstick_y;
|
||||
|
|
2
native
2
native
|
@ -1 +1 @@
|
|||
Subproject commit 91114ba60554713da98d4c23aeb533e2da650397
|
||||
Subproject commit cace0b3a65e8f3edb6c765526b285a9d97f609db
|
Loading…
Add table
Reference in a new issue