- Home /
Block all input while console is opened
I've created a console GUI, but the problem is that when I type some text into it, my character moves and everything too. Is there a way to block the input to everything except the console while it is opened?
Comment
Answer by nventimiglia · Jul 04, 2012 at 12:04 AM
public static class InputManager {
public staic bool BlockInput;
}
When the console is open, set InputManager.BlockInput to true;
In your game loop, check is BlockInput is true, if so do not read input.
Do I actually have to create an Input $$anonymous$$anager for this to work? It would be nice if I could do this in the Input class.