adding keyListener to main component