My code isn't working, can someone please help

Did we ever get an answer to this?

In order for an KEY_LEFT_ALT to do anything it has to be held down while another key is being pressed. Form what I can see of the code it looks like a key all keys are cleared after 300mS.