mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-10 08:12:39 +00:00
Make TouchButton not always override other input. Modify mappings.
This commit is contained in:
parent
8fd4f592ad
commit
1556328129
@ -91,14 +91,14 @@ void LaunchEmail(const char *email_address)
|
||||
|
||||
|
||||
const int buttonMappings[14] = {
|
||||
SDLK_x, //A
|
||||
SDLK_s, //B
|
||||
SDLK_z, //X
|
||||
SDLK_a, //Y
|
||||
SDLK_z, //A
|
||||
SDLK_x, //B
|
||||
SDLK_a, //X
|
||||
SDLK_s, //Y
|
||||
SDLK_w, //LBUMPER
|
||||
SDLK_q, //RBUMPER
|
||||
SDLK_1, //START
|
||||
SDLK_2, //SELECT
|
||||
SDLK_SPACE, //START
|
||||
SDLK_v, //SELECT
|
||||
SDLK_UP, //UP
|
||||
SDLK_DOWN, //DOWN
|
||||
SDLK_LEFT, //LEFT
|
||||
|
@ -16,6 +16,7 @@ TouchButton::TouchButton(const Atlas *atlas, int imageIndex, int overlayImageInd
|
||||
|
||||
void TouchButton::update(InputState &input_state)
|
||||
{
|
||||
bool oldIsDown = isDown_;
|
||||
isDown_ = false;
|
||||
for (int i = 0; i < MAX_POINTERS; i++) {
|
||||
if (input_state.pointer_down[i] && isInside(input_state.pointer_x[i], input_state.pointer_y[i]))
|
||||
@ -24,7 +25,7 @@ void TouchButton::update(InputState &input_state)
|
||||
|
||||
if (isDown_) {
|
||||
input_state.pad_buttons |= button_;
|
||||
} else {
|
||||
} else if (oldIsDown && !isDown_) {
|
||||
input_state.pad_buttons &= ~button_;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user