Another thing you could do with with EvilSOB's answer:
Let's say we've got multiple text boxes that a user could click on and type things.
When they click on a box, make the first command inkey_active = 0; You could also use OFF. Then it activates inkey for that box. Why? Because the user might already have inkey active for something else, and it must be terminated. So don't forget to keep that in mind. I created quite a few bugs by not doing that before.