Somewhat related to this question.
I have a game built in the ACM Graphics Library. I want to be able to pause the game upon a keypress of the P key. However I've looked in the documentation and there seems to be a mention of key listeners briefly but no actual examples of them in use in this context (unless I've missed something).
I don't want to use a console or dialogue box as I don't want to enter data via the keyboard, I just want to be able to toggle my pause method on and off using the P key within my main game loop. Is this possible?
See Question&Answers more detail:os