love.keyboard.setTextInput optional params don't work

Create issue
Issue #79 resolved
Former user created an issue

The optional parameters for x, y, width, and height don't seem to work. Maybe my device? Samsung Galaxy S3.

Comments (12)

  1. Alex Szpakowski

    I forgot to add the functionality to the mobile-common branch of LÖVE (which love-android uses) until recently, so it should work once @fysx merges the changes into love-android.

  2. Martin Felis repo owner

    The current release 0.9.1b includes the mentioned functionality. Would be great if someone could test this. Could take some time until I get to do this...

  3. Juno Nguyen

    @MartinFelis @slime73 I would like to test this so we can close the issue, but I have little idea what was talked about.

    Is there any documentation of how this function was extended?

  4. Martin Felis repo owner
  5. Juno Nguyen

    @MartinFelis I have been having hits and misses with these parameters. What exactly do they do?

    I noticed that the game occasionally is translated upwards by h pixels, probably to prevent the keyboard from covering the game, but that's not always either.

  6. Alex Szpakowski

    The optional x/y/width/height parameters are there to tell the system where your text will show up on the screen, so that the on-screen keyboard will (in theory) avoid covering it.

  7. Juno Nguyen

    Oooooooh, I see. That's a way more complicated function than I thought.

    Technically, it works. However, the function has to run at least once before the game is translated upwards. So what needs to be done:

    1. Tap a designated point to activate the keyboard (the game is not translated).
    2. Deactivate the keyboard.
    3. Tap the designated point again. Only by now, the game is translated to reveal the input box. The function works perfectly everytime from this point.

    Is that how it is meant to work?

  8. Alex Szpakowski

    Are you using the latest nightly build of love-android, or 0.9.1b? I believe there was a bug (my fault) in 0.9.1b where you had to call the function twice for the rectangle parameters to take effect, but it should be fixed in the latest code.

  9. Juno Nguyen

    I'm currently on a (minorly) forked version of 0.9.1b. I do not have the source on my PC now, but I will make a pull and confirm this soon enough.

  10. Log in to comment