matplotlib/matplotlib — pull request #1848 by ivanov (2013-03-22 19:19:12+00:00)
Title: add flushing of stdout to update on key event

Doing this as a demo for UC Berkeley Practical Neuroimaging class on
contributing to open source while getting your work done. This demo only printed the previous key *after* you pressed another key.

With these changes, we print the key that was last pressed immediately after the event