I solved a somewhat tricky problem this morning. AGK Particle Sandbox has a lot of data fields that can be changed by the user. For each window, I include "accept" and "cancel" buttons, so the user has a chance to either accept the changed data, or cancel and keep the original values. Well, because I anticipate the Sandbox mainly being used on systems with attached keyboards, I want to use the standard convention of hitting the ENTER key for okay or accept, and the ESC key for cancel or exit.
Well, AGK's text input routine puts up an input window, and there's only two ways to end this input. Care to guess what they are? That's right, ENTER or ESC. And when the user is done with the input, the very last key that was hit is passed back to the running code.
So, every time I asked the user for an input, I was getting an extra ENTER or ESC keypress. Argh! The solution was to use a pair of flags to test for those two characters after an input, and just ignore them the first cycle through the program loop.
Not a big deal, but it lets me give the user a handy feature!