[iOS] love.keyboard.setTextInput and SDL_SetTextInputRect

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
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

[iOS] love.keyboard.setTextInput and SDL_SetTextInputRect

Post by Ulydev »

Hello everyone,

I'm making a game for mobile devices in which there is some kind of text input.
Everything works fine, but here's the thing: I'm using love.keyboard.setTextInput with the x, y, width and height parameters to make sure the text input field doesn't get covered by the keyboard. It seems to work when I first open the app, but as soon as I call love.keyboard.setTextInput(false) and then turn it back on, the keyboard seems to ignore the virtual bounds and covers the game.

Even more weird, it seems to work again when I quickly turn it on and off.

Here's the culprit:

Code: Select all

local bounds = {
  x = 0,
  y = love.graphics.getHeight() * .5,
  width = love.graphics.getWidth(),
  height = love.graphics.getHeight() * .5
}
love.keyboard.setTextInput(true, bounds.x, bounds.y, bounds.width, bounds.height)
And here is a screen recording:


Has this ever happened to you? Do you have any idea, or any workaround for it?

Thanks in advance for your help!
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: [iOS] love.keyboard.setTextInput and SDL_SetTextInputRect

Post by Ulydev »

Well, I ended up making my own thing :-)

Looks like a bug with SDL and the recent iOS updates.

Post Reply

Who is online

Users browsing this forum: No registered users and 84 guests