remove double keyboard handler
made API for player state change
pep8ed the code