Im trying to get my each around this event based programming and I can't seem to solve this problem of using the same keyboard button to toggle a state on or off.
Attached is my implementation:
What it is suppose to do:
When the black square moves (using the w,a,s,d keys) to a grey square and presses the space button (while facing the square) a message pops up and the black sprite is frozen until the interaction message is terminated with the space button again. However I am unable to terminate the interaction message with the space button and I am temporary using the control button to terminate the interaction message. This is because the space triggers both popup and termination of the message at the same time. This is where I need help. If you don't get what I mean please download the file from the dropbox link.