1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Android "keyboard_string" refreshes every step

Discussion in 'GameMaker Studio 2 Community Tech Support' started by zzzzza1, Aug 10, 2018.

  1. zzzzza1

    zzzzza1 Member

    Joined:
    Jan 21, 2017
    Posts:
    33
    Hi everyone!

    I downloaded the new version of GMS2 (version 2.1.5.322) and I had a problem with variable "keyboard_string". When I compile for Windows, everything works well. But when I compile for android, the variable "keyboard_string" is reset to zero (empty string, i.e. "") every step. Before the update everything worked well.

    I think this is somehow related to the new functions of the virtual keyboard. ("keyboard_virtual_...").

    How to solve this issue?

    Thank you in advance!
     
  2. gnysek

    gnysek Member

    Joined:
    Jun 20, 2016
    Posts:
    1,306
    How you were setting keyboard_string in previous versions on android, where it wasn't supported on android, because there were no keyboard functions? You were assigning to it manually? Then now just use own variable, cause for sure it's reset every step, as when virtual keyboard is hidden nothing can be entered into that string.
     
  3. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,988
    Could you possibly post a link to a test YYZ that shows the issue? Afaik, it shouldn't be getting reset every step, but without seeing what you're doing it's difficult to say whether it's something you're doing or a bug. In my own tests it all works as it should, so I'd be interested to see what you're doing...
     
    Last edited: Aug 13, 2018
  4. flykidsblue1

    flykidsblue1 Member

    Joined:
    Jul 6, 2017
    Posts:
    40
    This is exactly the problem I am having, I wasn't sure what was causing it, but now I noticed that it was the new updated refreshing the keyboardstring

    I have the exact same issue, I have been trying to compile a project with the new runtime and I am notiving that the keyboardstring also get reset every step. I have not done any changes to my game whats o ever and compiled it the way it is with this new update so I can confirm it's a bug
     
    Last edited by a moderator: Aug 13, 2018
  5. zzzzza1

    zzzzza1 Member

    Joined:
    Jan 21, 2017
    Posts:
    33
  6. studio furukawa

    studio furukawa Member

    Joined:
    Jun 22, 2016
    Posts:
    117
    Yeah this needs to be fixed, also they should make a function called keyboard_virtual_return_pressed, would make more sense when it is the only button we are having trouble with.
     
  7. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,988
    Okay, so, there is indeed a bug with the keyboard_string being cleared and a coming update will address this. It also appears that the return is not being processed quite right on some Android devices, and so is giving issues. We'll look into how we deal with this consistently across all devices and platforms, but for now I beleive that checking the keyboard_lastchar will work (on all platforms), like this:

    Code:
    if keyboard_lastchar == chr(10)
    {
    //do something
    }
    Please let me know if this works for you.
     
    FredFredrickson and flykidsblue1 like this.
  8. Dan

    Dan YoYo Games Staff YYG Staff

    Joined:
    Apr 15, 2016
    Posts:
    345
    I've just dealt with a ticket linking to this post, so thought I would come give the same info here.

    The change for https://bugs.yoyogames.com/view.php?id=27584 has been made for 2.2.1, not today's 2.2.0, but has seemingly sorted the Android issue also and so the sample on the ticket we were sent now works fine in our internal versions.
     
    FredFredrickson likes this.
  9. FredFredrickson

    FredFredrickson Member GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    120
    Thanks for the updates, guys!

    Seems to work for me on my Galaxy Tab S2. Will let you know if I notice it not working elsewhere, though.
     
    Nocturne likes this.
  10. flykidsblue1

    flykidsblue1 Member

    Joined:
    Jul 6, 2017
    Posts:
    40
    keyboard_string is still being cleared every step... no fix there...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice