Quote: "Sixty Squares' snippet is the only good one"
You can't say that!!
That means you are saying that all the other suggestions are bad - which is not the case.
In fact, all the snippets did what Paul08 asked for - despite the fact that Sixty Squares code snippet
is most definitely the better way to do it in
some situations.
So, none of the solutions were bad because they all did what was asked for. It wasn't known at the time if the program freezing mattered but as Paul08 included the phrase:
Quote: "takes this key press on release"
..it suggested that it didn't matter. For example, on a screen where you set up a game character's attributes it probably wouldn't matter.
Obviously there are many cases where pressing a key and the program
not stopping could be problematic.
TDK_Man