Cancelling an action puts the last pressed button in the message buffer.
The last option selected (I.E. Y/N) stays in the top left corner until a turn or 10-20 have passed
In most recent versions without NotEye integration (most recently r69) the message buffer in the top of the screen does not clear after cancelling certain actions, and puts the last option selected in the message buffer until it clears.
For instance: Cast a spell that requires you to input a direction and press z. The message buffer will now display z until something else shows up. It's rather distracting.