key detection, player
refactor