newTextFiled Problem


I’ve been using display.newTextField for a decade
I have also been using this property for a decade as well
.inputType = "number"

Now my problem is with decimal numbers, which is allowed by the keyboard because it shows the DOT
but you are not allowed to type it

like 2.5 for example

Is there a way to fix it? I still need the number input type because entering numbers with an Arabic keyboard is not recognized as numbers somehow


  1. 5 is not only number.

.inputType = "number"

set keyboard to allow only numeric entry. You have to choose

.inputType = “default”

in this case.

I know there are only 3 cases. (numeric, alphanumeric and special character).
there is no special character and numeric at the same time.

but if you only want to use decimal you can try it.
.inputType = "decimal"
Remember with .inputType = "decimal" you don’t have chosen numeric keypad

Solar2D Documentation — API Reference | type | TextField | inputType (

Thanks man, decimal worked perfectly