Panel handling keyboard input

I am creating a pull request for this branch only to comment more easily.