diff --git a/MLEM/Misc/TextInputWrapper.cs b/MLEM/Misc/TextInputWrapper.cs index fed5b21..f8f61c8 100644 --- a/MLEM/Misc/TextInputWrapper.cs +++ b/MLEM/Misc/TextInputWrapper.cs @@ -15,9 +15,9 @@ namespace MLEM.Misc { throw new InvalidOperationException( "The TextInputWrapper was not initialized yet. Please do so before running your game like so:\n" + "DesktopGL: TextInputWrapper.Current = new TextInputWrapper.DesktopGl((w, c) => w.TextInput += c);\n" + - "Mobile and Consoles: TextInputWrapper.Current = new TextInputWrapper.Mobile();\n" + - "Other Systems: TextInputWrapper.Current = new TextInputWrapper.Primitive();\n" + - "Note that the primitive wrapper needs to have its Update() method called."); + "Mobile and consoles: TextInputWrapper.Current = new TextInputWrapper.Mobile();\n" + + "Other systems: TextInputWrapper.Current = new TextInputWrapper.Primitive(); (also call Update() every game tick for this one)\n" + + "No text input: TextInputWrapper.Current = new TextInputWrapper.None();"); return current; } set => current = value; @@ -66,6 +66,17 @@ namespace MLEM.Misc { } + public class None : TextInputWrapper { + + public override bool RequiresOnScreenKeyboard() { + return false; + } + + public override void AddListener(GameWindow window, TextInputCallback callback) { + } + + } + public class Primitive : TextInputWrapper { private TextInputCallback callback; diff --git a/Sandbox/Program.cs b/Sandbox/Program.cs index cd8cb41..082653c 100644 --- a/Sandbox/Program.cs +++ b/Sandbox/Program.cs @@ -5,7 +5,7 @@ namespace Sandbox { internal static class Program { private static void Main() { - TextInputWrapper.Current = new TextInputWrapper.DesktopGl((w, c) => w.TextInput += c); + //TextInputWrapper.Current = new TextInputWrapper.DesktopGl((w, c) => w.TextInput += c); using (var game = new GameImpl()) game.Run(); }