mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-27 21:14:21 +01:00
fix issue with on-screen keyboard
This commit is contained in:
parent
0e45f3bf09
commit
de067e5e6b
@ -17,12 +17,7 @@ static char * GetDisplayText(char * t)
|
|||||||
if(!t)
|
if(!t)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
int len = strlen(t);
|
snprintf(tmptxt, MAX_KEYBOARD_DISPLAY, "%s", t);
|
||||||
|
|
||||||
if(len < MAX_KEYBOARD_DISPLAY)
|
|
||||||
return t;
|
|
||||||
|
|
||||||
snprintf(tmptxt, MAX_KEYBOARD_DISPLAY, "%s", &t[len-MAX_KEYBOARD_DISPLAY]);
|
|
||||||
return &tmptxt[0];
|
return &tmptxt[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,16 +325,19 @@ void GuiKeyboard::Update(GuiTrigger * t)
|
|||||||
|
|
||||||
if(keyBtn[i][j]->GetState() == STATE_CLICKED)
|
if(keyBtn[i][j]->GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
if(strlen(kbtextstr) < kbtextmaxlen)
|
int len = strlen(kbtextstr);
|
||||||
|
|
||||||
|
if(len < kbtextmaxlen-1)
|
||||||
{
|
{
|
||||||
if(shift || caps)
|
if(shift || caps)
|
||||||
{
|
{
|
||||||
kbtextstr[strlen(kbtextstr)] = keys[i][j].chShift;
|
kbtextstr[len] = keys[i][j].chShift;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
kbtextstr[strlen(kbtextstr)] = keys[i][j].ch;
|
kbtextstr[len] = keys[i][j].ch;
|
||||||
}
|
}
|
||||||
|
kbtextstr[len+1] = '\0';
|
||||||
}
|
}
|
||||||
kbText->SetText(GetDisplayText(kbtextstr));
|
kbText->SetText(GetDisplayText(kbtextstr));
|
||||||
keyBtn[i][j]->SetState(STATE_SELECTED, t->chan);
|
keyBtn[i][j]->SetState(STATE_SELECTED, t->chan);
|
||||||
|
Loading…
Reference in New Issue
Block a user