Switching Controls

I want to use a factory method to manage my controls for my game. If I initialize my menu game state, I want to make sure the KeyInput is disabled… if I initialize my in-game game state I want to make sure the KeyInput is configured correctly for the game. If I have another game state where I use different controls, I want to make sure those are appropriate…



I am going to accomplish this by having the factory method have methods like bindForGame(), bindForMenu(), etc. My question is if I call KeyInput.destroyIfInitialized() will it just clear all of the key bindings (so you can't run around while the main menu is on?) and then I can just begin rebinding them to other things (like menu shortcuts)?

I would suggest looking into the GameControls features instead as they have support for all of that.