In my VB6 program, I have tons of hotkeys such as X, A, D… ETC . I also have a chat system in it, where everytime I use the characters X or A it will do the actions of those hotkeys. For example, if X was to close the application (not that it really does), when I am typing “fiXing” into my chat textbox, it will close the application. Can anyone tell me how to disable the hotkeys when typing EXCEPT the Enter Key?
thanks,
Kevin
In the chat
TextBox‘sGotFocusevent set a flag to disable your hotkeys. Then re-enable them in theTextBox‘sLostFocusevent.I don’t know how you trap your hotkeys, but the code to set the flag is pretty simple:
Then in the code that traps the hotkeys, just check the flag: