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
Did you know we can rotate objects in the room editor now┐ =)
Sneak Peak at my upcoming game [ScreenShot]
//Don't drink and script you may crash your computer.
Posted Image

#2 Destron

Destron

    GMC Member

  • GMC Member
  • 1251 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

HTML5 INI Saving Example | HTML5/GMS Saving/Loading/User Login with PHP/MySQL/Async | GameMaker Examples/Tutorials
Those who try to do something and fail are infinitely better than those who try to do nothing and succeed.


#3 gnysek

gnysek

    GMC Member

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

Posted 17 March 2012 - 12:20 PM

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

Previously game developer at YoYoGames, Currently PHP developer in DB-Team
Programming and working with: GML/C#/PHP/JS/MySql/CSS/HTML

Follow 
@GameMakerUpdate to get info about latest versions of GM when they are released: https://twitter.com/GameMakerUpdate

(it's managed by bot, not by human, remember)


#4 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2720 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
Did you know we can rotate objects in the room editor now┐ =)
Sneak Peak at my upcoming game [ScreenShot]
//Don't drink and script you may crash your computer.
Posted Image

#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
  • 2720 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
  • 201 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
  • 760 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

 

"It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter." - Nathaniel Borenstein

 

 

 


#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

              FF_Viking-Antics_Small.png               ParticleGizmo.png


#17 TeamSteeve

TeamSteeve

    GMC Member

  • GMC Member
  • 1347 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

rCf1TdL.gif


#18 ObsidianNovels

ObsidianNovels

    GMC Member

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

Posted 10 November 2012 - 07:09 AM

me 2
  • 0

#19 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16628 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
  • 8 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
  • 2720 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
  • 577 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

Previously game developer at YoYoGames, Currently PHP developer in DB-Team
Programming and working with: GML/C#/PHP/JS/MySql/CSS/HTML

Follow 
@GameMakerUpdate to get info about latest versions of GM when they are released: https://twitter.com/GameMakerUpdate

(it's managed by bot, not by human, remember)


#23 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2720 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
Be sure to check out my first game: Battle for Plangoria

#25 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 23565 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

Button_DynamicPuddles_zps068ef8eb.png Button_Flappy_zps7fcff3b6.png Button_RogueLike_zps6f3451a3.png IKrQvWr.png Button_MyGames_zpse9e80bb0.png


#26 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16628 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
Be sure to check out my first game: Battle for Plangoria

#28 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16628 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
  • 467 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
7757C.png sharkhugs_banner.png

#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

#31 TeamSteeve

TeamSteeve

    GMC Member

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

Posted 03 April 2013 - 04:33 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.

This doesn't really have anything to do with accessing the virtual keyboard, but I agree that it is a problem. One which YoYo doesn't seem eager to fix.


  • 0

rCf1TdL.gif


#32 e_barroga

e_barroga

    ES Studios Leader

  • GMC Member
  • 2451 posts

Posted 04 July 2013 - 02:54 AM

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

Russell

Why not?


  • 0

rsa_gmc_sig.png


#33 Arusiasotto

Arusiasotto

    GMC Member

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

Posted 04 July 2013 - 05:23 AM

 

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

Russell

Why not?

 

I would assume cross platform capabilities. Plus users have already shared methods to achieve this using existing code.


  • 0

 

"It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter." - Nathaniel Borenstein

 

 

 


#34 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16628 posts
  • Version:GM:Studio

Posted 04 July 2013 - 05:36 AM

I made my own in a few hours. Works on all platforms so.
  • 0

#35 TeamSteeve

TeamSteeve

    GMC Member

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

Posted 04 July 2013 - 06:02 AM

I made my own in a few hours. Works on all platforms so.

That's definitely an option, but still not good enough in my opinion.

As a user, I hate being forced to use any keyboard other the one I've set up on my mobile devices especially if I have a hardware keyboard. I'm sure other users feel the same.

 

I'm using the async message boxes at the moment, but I'm really hoping for a better fix in the future.

 

When we're able to add extensions to mobile games, hopefully we'll be able to enable keyboard input from the user's keyboard of choice on all mobile platforms.


  • 0

rCf1TdL.gif


#36 Arusiasotto

Arusiasotto

    GMC Member

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

Posted 04 July 2013 - 07:06 AM

An extension to call an async_get_string() into a field would be nice. My only problem with async_get_string() is the pop up. Mind you, I don't really use text inputs often.

 

On another note, full hardware keyboard support on mobile. I shall never stop wishing for this to happen.


  • 1

 

"It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter." - Nathaniel Borenstein

 

 

 


#37 TuxSoft

TuxSoft

    GMC Member

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

Posted 18 August 2013 - 09:08 AM

get_string_async() has to be one of the most useless solutions offered, this is more of a debug option IMO, you don't really expect people to use this ugly dialog in production ?

 

Come on guys this is a simple request, you are forcing people to make their own virtual KB's and that's not helping to make apps look polished.


  • 2

#38 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16628 posts
  • Version:GM:Studio

Posted 18 August 2013 - 06:47 PM

An extension to call an async_get_string() into a field would be nice. My only problem with async_get_string() is the pop up. Mind you, I don't really use text inputs often.
 
On another note, full hardware keyboard support on mobile. I shall never stop wishing for this to happen.


They would simply need to add other messages status, OK, Cancel, Update, Go, Next (I seen those for entry forms). the update one would happen on content change. There you can update your field. Next would allow you the change field association and maybe set If Go should be displayed.
We also need to be able to cancel/close the input box ourselves.

asyncid = get_string_async();
...
async_cancel(asyncid);

And maybe add a async_change_text(asyncid,"New Text")
  • 0

#39 Manuel777

Manuel777

    InvaderGames

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

Posted 18 August 2013 - 07:02 PM

As far as I have tested In Android, the problem is that the keyboard requires an input layout to be opened, there is no direct function to open a keyboard and get its string stream without this. And unfortunately we cannot add inputs into GMS, because GMS works in a static layout working like a 'canvas' (sorry if im not being technically correct here..)

 

In theory we could keep a hidden input outside the screen in the game's layout XML.. and handle the input and soft keyboard with it, but I havent got that far off in Java yet :P

 

As of now, virtual keyboards work like a charm, even the simplest ones. You can make even more complex ones with surfaces and multi touch input, and that would be totally nor equally acceptable :)


  • 0

#40 CloudBomb

CloudBomb

    GMC Member

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

Posted 04 March 2014 - 02:20 AM

I hate to necro this, I was looking up various ways people were handling this, and wanted to give my input.

The virtual keyboard itself runs into many problems, special character inputs being the biggest one, especially language support. It's way way way better build your own and have total control over what is going on - PLUS you can skin/design/make special effects that no other "standard keyboard" using application/game will be able to do! It's a good way to set yourself apart.

Take the time to build a universal keyboard program that you can incorporate in all your games, and you'll find it's a wonderful alternative.


  • 0

LL1vYs6.png





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users