Page 1 of 1

Changing the keyboard style in Android & iOS

Posted: Fri May 14, 2021 5:45 am
by KallioSanteri
Hey!

I am making a math game on love2d, that I would eventually release on android and ios. Having a full text keyboard just for numbers is not ideal, so how would i go about changing the mobile keyboard to the native number keyboard on ios and android?

Ideally it would only be a num keyboard when in-game, so other details could be entered as well. But if that's not possible, it could be a num keyboard all the time.

Cheers, Santeri

Re: Changing the keyboard style in Android & iOS

Posted: Fri May 14, 2021 4:59 pm
by ReFreezed
I'm just wondering - why not make you own virtual in-game keyboard?

Re: Changing the keyboard style in Android & iOS

Posted: Fri May 14, 2021 6:16 pm
by KallioSanteri
ReFreezed wrote: Fri May 14, 2021 4:59 pm I'm just wondering - why not make you own virtual in-game keyboard?
That was on my mind as well, but I just thought that the built-in keyboard would function better and be more elegant. And it would definitely save me some coding! :P

Re: Changing the keyboard style in Android & iOS

Posted: Mon May 24, 2021 3:27 pm
by AuahDark
KallioSanteri wrote: Fri May 14, 2021 5:45 am Hey!

I am making a math game on love2d, that I would eventually release on android and ios. Having a full text keyboard just for numbers is not ideal, so how would i go about changing the mobile keyboard to the native number keyboard on ios and android?

Ideally it would only be a num keyboard when in-game, so other details could be entered as well. But if that's not possible, it could be a num keyboard all the time.

Cheers, Santeri
Unfortunately SDL doesn't expose the API for this.

love.keyboard.setTextInput is basically thin wrapper around SDL_SetTextInputRect, so if SDL doesn't expose the keyboard mode, then LOVE can't.

Feel free to create feature request on SDL repository however.