I\'m new to Java graphics and threads, and I\'m trying to make a game (specifically, Pong). The idea is that two people can play on the same keyboard (i.e. there are two pad
This may be a legitimate use case for the low-level access afforded to a KeyListener. See How to Write a Key Listener and KeyEventDemo; don't forget to requestFocusInWindow()
. Also consider offering keyboard control for one player and mouse control for the other.
Addendum: @David Kroukamp has adduced an appealing counter-example using key bindings. For reference, the example cited here illustrates one approach to managing key preferences.