Arrow keys to move and number keys to change hats (you can only change hats once you've unlocked them). Try to collect all the hats, as some levels will require certain hats. Press p to go to menu. If you press p instead of the green flag to go to menu, you'll still be able to use any hats you've unlocked.
This game is currently unfinished, so please report any bugs or glitches in the comments. Special thanks to Gorilli for his text engine, and James OuO for his tutorials.