<keyboard_pressed any>
keyboard_key_press("A");
io_handle();
if (keyboard_lastchar != "" && string_letters(keyboard_lastchar) == keyboard_lastchar)
{
if ((string_upper(keyboard_lastchar) == keyboard_lastchar && !keyboard_check(vk_shift)) or (keyboard_check(vk_shift) && string_lower(keyboard_lastchar) == keyboard_lastchar))
{Caps = 1;} else {Caps = 0;}
}
if (LastCaps != Caps) {CapsPressed = 1;} else {CapsPressed = 0;}
if (keyboard_lastkey == vk_backspace)
{
if (ActiveTextbox == 1) {User = string_copy(User,1,string_length(User)-1);}
if (ActiveTextbox == 2) {Password = string_copy(Password,1,string_length(Password)-1);}
}
else if (keyboard_lastchar != "#" && keyboard_lastkey != vk_shift && !CapsPressed)
{
var Key;
Key = keyboard_lastchar;
if (keyboard_check(vk_shift)) {Key = string_upper(Key);}
Key = string_lettersdigits(Key);
if (ActiveTextbox == 1 && string_length(User) <= 16) {User += string_upper(Key);}
if (ActiveTextbox == 2 && string_length(Password) <= 16) {Password += Key;}
}
LastCaps = Caps;
Is my current code. It treats all characters as caps and pressing capslock adds the last pressed key in caps...
What I'm trying to do is get the case of the key. Then if it's not capslock being pressed, add the last keyboard pressed to either User or Password. Then save the last case used. If, on next keyboard pressed the case has changed, then we pressed capslock, so lets not add anything.
I'm kinda out of it at the moment, sorry.
Edited by jon sploder, 06 January 2011 - 04:58 AM.











