I'll try to explain better what I mean, and I'll also try to keep the question free from language, though if there is a way to do what I want in C# without having to reference anything it'd be nice. Anyway.
I am handling keyboard input, and converting it to string. All fine. I get the status for the Shift and CapsLock keys and EXOR it so I can figure out the casing for the resulting string.
bool shift = KeyDown(SHIFT_KEY)
bool capslock = KeyToggled(CAPSLOCK)
bool stringCasing = shift ^ capslock //if both are true/false, the string will be lowercase. Otherwise uppercase.
foreach Key k in [list of keys passed as parameter]
char c = (char)k
if stringCasing
c = Char.ToUpper(c)
else
c = Char.ToLower(c)
end foreach
And no problems for now. If a user types "a" while holding shift or having capslock toggled, it becomes a "A".
However, if a user decides to type "!", which is "1" plus shift I only get a 1, because "1" uppercase is still "1".
I looked a bit on the web before asking this question, but all I got was "Map the keys yourself". Is that really the only answer? And also, what would happen if I mapped the keys and then a user with a different keyboard layout tried to use my application? Thanks in advance.