Textbox Character Glitch

I don’t know how common this glitch is, but it seemed to happen pretty easily, so… Anyway, when I was coding an input box, there was a point where it would only type certain letters in either uppercase or lowercase. If this helps, here are the letters:

Only lowercase: a, d, l, m, u, x, y
Only Uppercase: C, E, F, G
Both: b, h, I, l, n, o, p, r, s, t
Neither: j, k, q, v, w, z

Can anyone explain and/or give a solution for this?