Just going to modify that a little...
var Finish = false;
var name = "";
/////
// Do your rendering of the name entry screen
//
flipscreen();
/////
// Process all key events
//
while(AreKeysLeft()){
var key = GetKey();
if(key == KEY_ENTER){
Finish = true;
break;
}
if(key == KEY_BACKSPACE)
name = name.substring(0, name.length-1); //This function is extremely forgiving.
else
name += GetKeyString(key,IsKeyPressed(KEY_SHIFT));
}
}
This way, there is no limit or enforcement of how many keys are processed per frame.
For instance, then when you draw the text of the name, you could do this:
font.drawText(lolX, lolY, name+((Math.floor(GetTime()/2000)%2)?"|":""));
That would put a cursor on the end of the name, and flash it at once a second.