Game Development Community

Caps Lock

by Howard Dortch · in Torque Game Engine · 11/11/2005 (10:20 am) · 3 replies

There seems to be a bit of a dis connect on the caps lock key and the chat hud.
The system keyboard caps lock works independant of the chat. If I start my program with the caps lock key on and enter chat all the text is in CAPS. I hit the caps lock key and the light turns out ( I assume the state changed) and all the text is still in caps and stays that way until I quit the game, unlock the key then re enter the game. I have been in the engine code trying to find where this all happens.
In processKeyMessage the caps lock is tested and set in the keyboardState[] array but that is not tested during the key events for the chat. Am I missing something here? I searched for this in the forums but there is little information.

#1
11/11/2005 (11:04 am)
OK thats not quite true. The caps lock is triggerd on and off when inside the chat hud. So say you opened the chathud with capslock on before, you won't have capslock triggered because tge only reads the keypress while in the chat box. So if you opened it and THEN pressed capslock you will have the text in caps, regardless of your keyboard light. Works the same way for turning it off, you have to have the chatbox open to turn off caps lock. So if capslock is off on your keyboard and you open the chatbox, it might still show caps, if you hit the capslock key again it'll get fixed. I haven't ever looked into why this happens since my game project doesn't involve the chat. Sorry I can't be of more help.

[Ishbuu]
#2
11/11/2005 (12:53 pm)
I see what you mean. However people are not used to doing things that way, my testers complain about it all the time. Caps should be caps. I guess the only thing to do is get the capslock state every time the chat window opens but that seems like a kludge. I stepped throught the code and the proper state of the caps lock is stored in the keyboardState[] array at index 14 hex. /ponder
#3
11/11/2005 (7:10 pm)
Which version of Torque does this happen in?