Basically I want the "i" key to open an inventory panel, I have already coded the buttons and stuff so its working I just cant get the panel to show and hide on a key press.

Although I would prefer a key press I thought I would make another button to open it but when I do open the panel and I set the close button to panremove when I click the inventory button again it doesnt show up.