added new signature for SendCommand in JGE that takes in a command string and a parameter

added native keyboard handling in iOS
TODO: add same feature for Android tablets/phones
This commit is contained in:
techdragon.nguyen@gmail.com
2011-12-15 11:11:08 +00:00
parent f9016f70ab
commit dc7d52c48c
14 changed files with 785 additions and 535 deletions

View File

@@ -44,7 +44,11 @@ SimplePad::SimplePad()
{
nbitems = 0;
bActive = false;
#ifdef IOS
selected = KPD_OK;
#else
selected = 0;
#endif
priorKey = 0;
cursor = 0;
bShowCancel = false;
@@ -175,11 +179,16 @@ void SimplePad::pressKey(unsigned char key)
Finish();
else if (key == KPD_CANCEL)
{
bCanceled = true;
Finish();
CancelEdit();
}
}
void SimplePad::CancelEdit()
{
bCanceled = true;
Finish();
}
void SimplePad::MoveSelection(unsigned char moveto)
{
if (!bShowNumpad && moveto >= KPD_0 && moveto <= KPD_9)
@@ -370,7 +379,8 @@ void SimplePad::Render()
offY += kH + 12;
if (!bShowNumpad) vSpacing -= kH + 12;
#ifndef IOS
for (int x = 0; x < nbitems; x++)
if (keys[x])
{
@@ -445,6 +455,7 @@ void SimplePad::Render()
mFont->DrawString(keys[x]->displayValue.c_str(), mX + offX, mY + offY);
offX += kW + 14;
}
#endif
}
unsigned int SimplePad::cursorPos()