add support for key presses and toggling