DUDE I CANT SEEM TO TURN MY HEAD WITHOUT ANOTHER PROBLEM!
This one is VERY weird! For some reason (no matter what key I press), there are 2 keys that type out with this code, those keys are "I" and "M" Even backspace for SOME unknown reason. Heres the code, it's in a key down event, with "any key" as the keys I'm doing it this way for a reason.
- Code: Select all
char *key=GetKeyState();
if (inputting_name == 1)
{
//Lower case keys
if (strlen(text)<9)
{
if (key[KEY_a] == 1)
{
strcat(text, "a");
}
if (key[KEY_b] == 1)
{
strcat(text, "b");
}
if (key[KEY_c] == 1)
{
strcat(text, "c");
}
if (key[KEY_d] == 1)
{
strcat(text, "d");
}
if (key[KEY_e] == 1)
{
strcat(text, "e");
}
if (key[KEY_f] == 1)
{
strcat(text, "f");
}
if (key[KEY_g] == 1)
{
strcat(text, "g");
}
if (key[KEY_h] == 1)
{
strcat(text, "h");
}
if (key[KEY_i] = 1)
{
strcat(text, "i");
}
if (key[KEY_j] == 1)
{
strcat(text, "j");
}
if (key[KEY_k] == 1)
{
strcat(text, "k");
}
if (key[KEY_l] == 1)
{
strcat(text, "l");
}
if (key[KEY_m] == 1);
{
strcat(text, "m");
}
if (key[KEY_n] == 1)
{
strcat(text, "n");
}
if (key[KEY_o] == 1)
{
strcat(text, "o");
}
if (key[KEY_p] == 1)
{
strcat(text, "p");
}
if (key[KEY_q] == 1)
{
strcat(text, "q");
}
}
//Backspace and Space keys
if (key[KEY_BACKSPACE] == 1)
{
if (strlen(text)>0)
{
strcpy(&text[strlen(text)-1], "");
}
}
}