Changing the keyboard style in Android & iOS

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
KallioSanteri
Prole
Posts: 19
Joined: Tue Jan 14, 2020 5:04 pm
Location: Finland

Changing the keyboard style in Android & iOS

Post 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
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Changing the keyboard style in Android & iOS

Post by ReFreezed »

I'm just wondering - why not make you own virtual in-game keyboard?
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
KallioSanteri
Prole
Posts: 19
Joined: Tue Jan 14, 2020 5:04 pm
Location: Finland

Re: Changing the keyboard style in Android & iOS

Post 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
User avatar
AuahDark
Party member
Posts: 107
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Changing the keyboard style in Android & iOS

Post 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.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests