Allow the OSK text input buttons to be held and thus repeat.
This commit is contained in:
parent
7bbbf4d4b6
commit
92ab821f14
3 changed files with 22 additions and 11 deletions
|
@ -128,7 +128,7 @@ bool PSPDialog::IsButtonPressed(int checkButton)
|
|||
return !isFading && !(lastButtons & checkButton) && (buttons & checkButton);
|
||||
}
|
||||
|
||||
bool PSPDialog::IsButtonHeld(int checkButton, int &framesHeld)
|
||||
bool PSPDialog::IsButtonHeld(int checkButton, int &framesHeld, int framesHeldThreshold, int framesHeldRepeatRate)
|
||||
{
|
||||
bool btnWasHeldLastFrame = (lastButtons & checkButton) && (buttons & checkButton);
|
||||
if (!isFading && btnWasHeldLastFrame) {
|
||||
|
@ -141,7 +141,7 @@ bool PSPDialog::IsButtonHeld(int checkButton, int &framesHeld)
|
|||
|
||||
// It's considered held for dialog purposes after 30 frames (~0.5 seconds).
|
||||
// Seems to give the best responsiveness. Maybe this should be configurable?
|
||||
if (framesHeld >= 30 && ((framesHeld % 10) == 0))
|
||||
if (framesHeld >= framesHeldThreshold && ((framesHeld % framesHeldRepeatRate) == 0))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue