The method that deals with keystrokes is processLoginScreenInput()
This is the important part of the method, past all the clicking shit.
Code:
int l1 = readChar(-796); //read keystrokes
if (l1 == -1) { //no new keystrokes
break;
}
boolean validChar = false; //is the character valid?
for (int i2 = 0; i2 < validUserPassChars.length(); i2++) { //check and see
if (l1 != validUserPassChars.charAt(i2)) {
continue; //it's not valid, break the loop
}
validChar = true; //it's valid, proceed
break;
}
and
Code:
if (loginScreenCursorPos == 0) {
if ((l1 == 8) && (myUsername.length() > 0)) { //backspace
myUsername = myUsername.substring(0, myUsername.length() - 1);
}
if ((l1 == 9) || (l1 == 10) || (l1 == 13)) { //enter or return
loginScreenCursorPos = 1;
}
if (validChar) {
myUsername += (char) l1; //add the keystroke
}
if (myUsername.length() > 12) {
myUsername = capitalize(myUsername.substring(0, 11)); //make sure it's not too long
}
}
Some of that is unique to my client, but the concept is the same.
The drawing part is handled in drawLoginScreen()
Code:
chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@[email protected]|" : ""), j);
j += 15;
chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@[email protected]|" : ""), j);
j += 15;
Or something similar to that.
You're gonna wanna watch the variable loginScreenState, but basically make sure you're processing the login stage that you're drawing.