Prefill the OSK when requested to.

This commit is contained in:
Unknown W. Brackets committed 2013-04-20 15:03:33 -07:00
1 parent 27cf72afb6
commit 75d8eca76f
2 files changed
+10 -7

No files matched your search

+9 -7
View File
@@ -112,7 +112,7 @@ int PSPOskDialog::Init(u32 oskPtr)
ConvertUCS2ToUTF8(oskIntext, oskData.intextPtr);
ConvertUCS2ToUTF8(oskOuttext, oskData.outtextPtr);
inputChars.clear();
inputChars = oskIntext.substr(0, FieldMaxLength());
// Eat any keys pressed before the dialog inited.
__CtrlReadLatch();
@@ -121,6 +121,12 @@ int PSPOskDialog::Init(u32 oskPtr)
return 0;
}
u32 PSPOskDialog::FieldMaxLength()
{
if (oskData.outtextlimit > oskData.outtextlength - 1 || oskData.outtextlimit == 0)
return oskData.outtextlength - 1;
return oskData.outtextlimit;
}
void PSPOskDialog::RenderKeyboard()
{
@@ -130,9 +136,7 @@ void PSPOskDialog::RenderKeyboard()
char temp[2];
temp[1] = '\0';
u32 limit = oskData.outtextlimit;
if (limit > oskData.outtextlength - 1 || limit == 0)
limit = oskData.outtextlength - 1;
u32 limit = FieldMaxLength();
const float keyboardLeftSide = (480.0f - (24.0f * KEYSPERROW)) / 2.0f;
float previewLeftSide = (480.0f - (12.0f * limit)) / 2.0f;
@@ -178,9 +182,7 @@ int PSPOskDialog::Update()
int selectedRow = selectedChar / KEYSPERROW;
int selectedExtra = selectedChar % KEYSPERROW;
u32 limit = oskData.outtextlimit;
if (limit > oskData.outtextlength - 1 || limit == 0)
limit = oskData.outtextlength - 1;
u32 limit = FieldMaxLength();
if (status == SCE_UTILITY_STATUS_INITIALIZE)
{
+1
View File
@@ -151,6 +151,7 @@ public:
private:
void ConvertUCS2ToUTF8(std::string& _string, const u32 em_address);
void RenderKeyboard();
u32 FieldMaxLength();
SceUtilityOskParams *oskParams;
SceUtilityOskData oskData;