Add menu and improve key handling