So I guess this is more a Xamarin thing but I was wondering if perhaps this is already covered by MonoGame inputs. I have managed to throw up a virtual keyboard pretty easily, but its for an age gate and I'm now stuck switching it to be numeric only.
Anyone got any experience with this?
Heres the code, might be useful for anyone else doing the same.
protected override void OnCreate(Bundle bundle)
var g = Game.Instance;
view = (View)g.Services.GetService(typeof(View));
inputMethodManager = Application.GetSystemService(InputMethodService) as InputMethodManager;
view.KeyPress += OnKeyPress;
editText = new EditText(this);
editText.InputType = Android.Text.InputTypes.ClassNumber;
g.ShowKeyboardAction = () => ShowKeyboard();
g.HideKeyboardAction = () => HideKeyboard();
private void ShowKeyboard()
private void HideKeyboard()
private void OnKeyPress(object sender, View.KeyEventArgs e)
// do stuff with the input