On screen keyboard to open the numpad

Hi, I am using libgdx for my dice game in which you have to insert a three digit number with numbers in the range of 0-6.

When I google on how to have the on screen keyboard show numbers when opened they tell you to set the keyboard type of a textfield on numbers. On the TextField class in multi os engine this would look like:
textfield.setKeyboardType(UIKeyboardType.NumberPad);

I created my own version of IOSInput.java below and added the above line to try and get the keyboard in numbers mode:
https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-moe/src/com/badlogic/gdx/backends/iosmoe/IOSInput.java

However it doesn’t matter which of the UIKeyboardType enum values I pass the keyboard always opens in letter mode.

Any idea how to get the onscreen keyboard to open as a phone number ish dialog box?

Tjere is no numpad on ipad. You will have to create your own UI control for that. There are couple of those on github

My app is an iPhone app though.

Got it working! Will post a code snippet on what to change when I cleaned my project up… It was simple, I was modifying the wrong part.

It did worked on iphone for me. I don’t remember details but it was a top answer about numeric keyboard on ios or objectivec on stackoverflow.

In my custom IOSInput fork class, I added the textField.setKeyboardType(UIKeyboardType.NumberPad);

@Override
public void getTextInput(TextInputListener listener, String title, String text, String hint) {
    buildUIAlertView(listener, title, text, hint).show();
}

/** Builds an {@link UIAlertView} with an added {@link UITextField} for inputting text.
 * @param listener Text input listener
 * @param title Dialog title
 * @param text Text for text field
 * @return UiAlertView */
private UIAlertView buildUIAlertView (final TextInputListener listener, String title, String text, String placeholder) {
    UIAlertViewDelegate delegate = new UIAlertViewDelegate() {
        @Override
        public void alertViewClickedButtonAtIndex (UIAlertView alertView, @NInt long buttonIndex) {
            if (buttonIndex == 0) {
                // user clicked "Cancel" button
                listener.canceled();
            } else if (buttonIndex == 1) {
                // user clicked "Ok" button
                UITextField textField = alertView.textFieldAtIndex(0);
                listener.input(textField.text());
            }
        }

        @Override
        public void alertViewCancel (UIAlertView alertView) {
            listener.canceled();
        }
    };

    // build the view
    final UIAlertView uiAlertView = UIAlertView.alloc().init();
    uiAlertView.setTitle(title);
    uiAlertView.addButtonWithTitle("Cancel");
    uiAlertView.addButtonWithTitle("Ok");
    uiAlertView.setAlertViewStyle(UIAlertViewStyle.PlainTextInput);
    uiAlertView.setDelegate(delegate);

    UITextField textField = uiAlertView.textFieldAtIndex(0);
    textField.setPlaceholder(placeholder);
    textField.setText(text);
    if (title.equals(CallInputDialog.ENTER_YOUR_CALL)) {
        textField.setKeyboardType(UIKeyboardType.NumberPad);
    }

    return uiAlertView;
}

The CallInputDialog.ENTER_YOUR_CALL class is my dialog class for number imput that brings up the keyboard. So I detect when that title is set to modify the keyboard type.