Jump to content


Photo

Accessing Android Virtual Keyboard


  • Please log in to reply
39 replies to this topic

#1 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 17 March 2012 - 05:16 AM

Be it a game or a browser, or just simply searching for something on your phone/tablet all of these things use the same built in default virtual keyboard(unless you downloaded an alternative). Is there a function to access a device's keyboard yet? i.e. bring it up/hide it.

To be honest this is a pretty important feature... I'm sure I just over looked the command...
  • 0

#2 Destron

Destron

    GMC Member

  • GMC Member
  • 1094 posts
  • Version:GM:Studio

Posted 17 March 2012 - 06:28 AM

I traditional Android development the IME is shown automatically when focused on an area that needs it such as an EditText field, I am sure the behavior will be handled in a similar manner in that we won't specify when the IME is shown but rather what items should call it when the are focused.
  • 0

#3 gnysek

gnysek

    GMC Member

  • GMC Member
  • 511 posts
  • Version:GM:Studio

Posted 17 March 2012 - 12:20 PM

AFAIK in current version of Studio, virtual keyboard isn't working.
  • 0

#4 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2171 posts
  • Version:Unknown

Posted 17 March 2012 - 01:42 PM

You will get the virtual keyboard if you use get_integer or get_string, but these functions are just for debug we will be providing new versions of these functions that work a synchronously, as most of the target os's do not allow busy waiting, it is a CPU and battery hog, windows is unusual in that it encourages the use of busy waiting functions, all these types of functions are being removed.

Russell
  • 0

#5 heysparky

heysparky

    GMC Member

  • GMC Member
  • 9 posts

Posted 02 April 2012 - 02:44 AM

Snip

You will get the virtual keyboard if you use get_integer or get_string, but these functions are just for debug


So if I use get_string and it works in the Windows C++ Runner, but not for iOS, is this a bug? Known or otherwise? (NOTE: I've been able to test and run on my iOS device, so the pipeline to the device is in place and working). If not a bug - what am I doing wrong?

userstr = get_string("keyboardTest", "")

I don't want to hijack, so if I should start a new thread, please let me know.
  • 0

#6 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 03 April 2012 - 01:40 AM

Snip


You will get the virtual keyboard if you use get_integer or get_string, but these functions are just for debug


So if I use get_string and it works in the Windows C++ Runner, but not for iOS, is this a bug? Known or otherwise? (NOTE: I've been able to test and run on my iOS device, so the pipeline to the device is in place and working). If not a bug - what am I doing wrong?

userstr = get_string("keyboardTest", "")

I don't want to hijack, so if I should start a new thread, please let me know.


No, by all means use the topic.
Anyways as Russel said "these functions are just for debug we will be providing new versions of these functions..."
I believe I read somewhere saying that the current functions are in for testing purposes, not as a final function yet.
So for now unless anyone else has more insight into it we're just going to have to wait and see.
  • 0

#7 heysparky

heysparky

    GMC Member

  • GMC Member
  • 9 posts

Posted 05 April 2012 - 06:34 AM

I can't bring up the keyboard on my mobile device using these functions, so I'm a little fuzzy on how they work for debugging. It's critical to an idea that I'm working on to take user input via the keyboard. I can work around it, but I'd like to work on that bit.
  • 0

#8 cotycrg

cotycrg

    GMC Member

  • GMC Member
  • 873 posts
  • Version:GM:Studio

Posted 06 April 2012 - 02:08 AM

It would be pretty nice to have some textbox options. I'm not quite sure how that would integrate into GM...but the YoYo team is clever. I'm sure they could figure it out.
  • 0

#9 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2171 posts
  • Version:Unknown

Posted 06 April 2012 - 09:13 AM

if you use get_string or get_integer then a dialog will appear with an input box, when you select the input box then the soft keyboard for your device will appear - unfortunately the way this function works means that if a phone call comes in while this is up, or another app comes to the front, or the screen saver kicks in then the function will break - so the get_string() function will only work on Test/Debug versions as we do not want products up on the market place that work badly for users.

If the soft keyboard is not working for you then please file a bug with an example - remember the keyboard will only appear if you select the input box and start inputting text...

We will be providing new functions that effectively do the same but they will work asynchronously so the GML code does not stop while the user is inputting the answer - this means they will work properly with the OS and handle things like phone calls and other interruptions.

Russell
  • 0

#10 heysparky

heysparky

    GMC Member

  • GMC Member
  • 9 posts

Posted 07 April 2012 - 08:11 AM

Understood. Thanks for the reply. I was hoping just what you answered was the case. However...

remember the keyboard will only appear if you select the input box and start inputting text...


I'm not seeing any input box on my iOS device. I have a very simple test case that draws two variables to the screen... a counter that counts down from 5 and a temp string that updates with the inputted (inpot? inputteded?) user name. It works as expected in the Windows C++ Runner, but not at all on my iOS device.

I want to make sure it's not user error before I log it as a bug. This is the code I'm using:

//input name

userName = get_string("Enter name:", "")


The behavior that I'm observing is that that line of code does run and blanks out my tempName, but I don't get to interface with it before this happens. Thoughts?
  • 0

#11 heysparky

heysparky

    GMC Member

  • GMC Member
  • 9 posts

Posted 08 April 2012 - 11:47 PM

Updated to current release and all is well. No bug - user error.

Thanks, folks.
  • 0

#12 dasrkrain

dasrkrain

    GMC Member

  • GMC Member
  • 196 posts
  • Version:GM:Studio

Posted 29 July 2012 - 01:28 AM

Do we have a release date yet for the new functions? I need the player to enter a name for his save file in android and as of right now I have no official way of doing that. If I just go ahead and use the get_string function it works with android, but it crashes my iPad every time. User input is a really big deal. This seems like it should be a huge priority.
  • 0

#13 knockedout

knockedout

    GMC Member

  • GMC Member
  • 57 posts
  • Version:GM:Studio

Posted 18 September 2012 - 01:38 PM

Don't want to create a new thread so there won't be multiple ones, so I would be reviving this one.

Are there any updates regarding this?
  • 0

#14 hexdump

hexdump

    GMC Member

  • GMC Member
  • 360 posts
  • Version:GM:Studio

Posted 17 October 2012 - 10:06 PM

I'm insteresed in this too... any news?
  • 0

#15 Arusiasotto

Arusiasotto

    GMC Member

  • GMC Member
  • 759 posts
  • Version:GM:Studio

Posted 18 October 2012 - 09:31 AM

The feature is not yet implemented. Your best bet is to use your own keyboard code. There are a couple floating around in the android subsection.
  • 0

#16 VikingAntics

VikingAntics

    GMC Member

  • GMC Member
  • 217 posts
  • Version:GM:Studio

Posted 10 November 2012 - 01:18 AM

OK, I think we have all been patient enough waiting for this feature! And show_message needs to work outside development too! I know there are user created alternatives for this, but seriously, it is already built into all of the mobile platforms. Why do we have to build our own???? This feature (and showing the keyboard should not be classified as a feature, in my opinion) was requested back in March 2012. It is now November.

Studio is a great product and improving in leaps and bounds, but using the built in keyboards should be considered core functionality. I'm begging you guys, please release access to the soft keyboards and a show_message/alert that we can use in releasing our games - Soon!

Thanks for letting me vent,
Maverick.
  • 2

#17 TeamSteeve

TeamSteeve

    GMC Member

  • GMC Member
  • 1280 posts
  • Version:GM:Studio

Posted 10 November 2012 - 02:21 AM

It's definitely a priority to me! I really really really want this functionality.
I think it's just tacky to use a keyboard other than the the one the mobile user has set up on their phone already.
  • 2

#18 ObsidianNovels

ObsidianNovels

    GMC Member

  • GMC Member
  • 526 posts
  • Version:GM:HTML5

Posted 10 November 2012 - 07:09 AM

me 2
  • 0

#19 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15716 posts
  • Version:GM:Studio

Posted 10 November 2012 - 08:32 AM

There is a new staff choice tutorial on an alternative which looked Ok, at least for the standard keys.

Definitly get_string() should pop the enter text standard keyboard... a version that does not pause the game would be nice too.
  • 0

#20 killer777

killer777

    GMC Member

  • GMC Member
  • 6 posts
  • Version:GM:Studio

Posted 16 February 2013 - 12:57 PM

when we can access ios and android virtual keyboards with new functions ? i really need this .
  • 0

#21 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2171 posts
  • Version:Unknown

Posted 16 February 2013 - 01:48 PM

You can access user input using get_string_async() or get_integer_async() they will use the keyboard on all platforms.

Russell
  • 0

#22 gnysek

gnysek

    GMC Member

  • GMC Member
  • 511 posts
  • Version:GM:Studio

Posted 19 February 2013 - 09:59 AM

It will be nice if there is a function keyboard_device_show() which will show android/ios keyboard, and input will go to keyboard_string - of course user need to clear keyboard_string himself before opening, then you can create nice own input fields. If it's not possible on those devices to assign keyboard string to some variable and text must go to some input, there can be always an input outside screen (invisible for user), which will be focused with keyboard_device_show() and unfocused by keyboard_device_hide() or "return" char, and text from that input will be copied to keyboard_string. Shouldn't be too hard to do (and after you've made "execute script" non-modal I don't believe in any other "it's not possible" that you say ;) ).
  • 0

#23 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2171 posts
  • Version:Unknown

Posted 19 February 2013 - 10:46 AM

No this is not something that we are going to do - use get_string_async() for this.

Russell
  • 0

#24 jhanley

jhanley

    GMC Member

  • GMC Member
  • 79 posts
  • Version:GM:Studio

Posted 20 February 2013 - 10:17 PM

I hate to jump on the bandwagon here, but I desperately need this as well.

In my case I'm building a series of HTML5 learning programs. My client is expecting full virtual keyboard support on tablets.

This thread is nearly a year old. What's the status of this very important feature implementation? What's the best alternative at this point?
  • 0

#25 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 20908 posts
  • Version:GM:Studio

Posted 20 February 2013 - 10:32 PM


I hate to jump on the bandwagon here, but I desperately need this as well.

In my case I'm building a series of HTML5 learning programs. My client is expecting full virtual keyboard support on tablets.

This thread is nearly a year old. What's the status of this very important feature implementation? What's the best alternative at this point?

No this is not something that we are going to do - use get_string_async() for this.

Russell


Russell gave the status in his post, I'm afraid. if you require an onscreen keyboard, you can always just code one yourself, it's not too complicated.... Posted Image So that's your best alternative. You can use for loops to detect touches across the screen, or even a series of virtual keys.
  • 0

#26 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15716 posts
  • Version:GM:Studio

Posted 20 February 2013 - 10:36 PM

Russell gave the status in his post, I'm afraid. if you require an onscreen keyboard, you can always just code one yourself, it's not too complicated.... Posted Image


We have a good one in the tutorials
  • 0

#27 jhanley

jhanley

    GMC Member

  • GMC Member
  • 79 posts
  • Version:GM:Studio

Posted 22 February 2013 - 04:43 AM

Can we expect virtual keyboard support for inline (aka. embedded) fields as well?

I'm in the process of converting a Flash movie to HTML5 using GMS. Everything is going smoothly except for the inability to include inline text area type fields. I know it's possible to roll my own custom field, but these will not invoke a native OS virtual keyboard.

I've been reading many threads on the subject, but there doesn't seem to be a definitive solution.

GMS implementation of HTML5 is great in so many ways, but I believe this issue is the major thing that's preventing it from being amazingly awesome.

Please, somebody biatch-slap me if there's a solution out there that's eluded me.

Edited by jhanley, 22 February 2013 - 04:45 AM.

  • 0

#28 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15716 posts
  • Version:GM:Studio

Posted 22 February 2013 - 05:04 AM

Please, somebody biatch-slap me if there's a solution out there that's eluded me.

post above yours.
  • 0

#29 ClassyGoat

ClassyGoat

    Goatee Connoisseur

  • GMC Member
  • 443 posts
  • Version:GM:Studio

Posted 24 February 2013 - 10:05 PM

Check out this on screen keyboard example I threw together: [STUDIO] On Screen Keyboard Example
And if you scroll down on that page, there are a few other examples made by other people too.
  • 1

#30 Myke113

Myke113

    GMC Member

  • New Member
  • 11 posts

Posted 03 April 2013 - 04:18 AM

I came upon this topic while looking for a solution to the keyboard problem.  I'm on an ASUS Transformer tablet, the arrow keys work on games, but the space bar doesn't work for jump, etc.  If I have a physical keyboard (not that unusual with Android anymore, with tablets and Bluetooth keyboards), then I should be able to detect keypresses cross platform.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users