HTML5 [SOLVED] How to spawn a native android/ios keyboard on HTML5?

Status
Not open for further replies.

Carbon

Member
Perhaps by intentionally invoking HTML5 text input or something with a javascript extension?

Also, no, I don't want 'fake' keyboards that you make your own by putting together bunch of letter sprites in such a way that replicates a keyboard.

I mean, even in canvas/webGL itself, is it even possible?
 

Carbon

Member
If you don’t want to share your solution for other users who may wonder the same thing in future and find this thread, then just report your own thread and have it deleted because as-is it’s as pointless as it is useless.
Already did, Mr. Wanna-Be-Mod. :)
 

Carbon

Member
I don't understand. He clearly gave me 2 options, in which I answered and chose the latter. What are you complaining?

Regardless, I very much prefer @TsukaYuriko's way of asking it, maybe instead of acting to be coming off ahead and calling things useless etc, you can simply ask about it? I don't understand why both of you are defending this edgy kid, but then again I realized its GMC. Ah, the classic. Well, you guys never change.

be nice and friendly not a cactus
Okay, now forward this to your friend over there while you two are having a tea party or something. :) Tell him to not be a cactus when asking in the first place.

Also, if someone asked something like "how to draw text" and he quickly found the solution after having made a thread, I suppose no one would bother to ask the solution, why? Because it's so simple that it's not worth explaining. Not unless someone simply asked for it.

I did not know that this thread was worth explaining since I quickly figured out that a simple jQuery replicating the behavior of pop up boxes carrying <textarea> does the trick.

Now that someone's asking for it, here it is

Solution: by using jQuery Dialog.

Here's an example.

HTML:
<div id="dialog">
   <p>Please enter your name</p>
   <textarea id="name"></textarea>
</div>
<label>Name entered: </label>
<label id="nameentered"></label>
<br />
<input type="button" id="open" value="Open Dialog" />
jQuery:
Code:
$("#dialog").dialog({
   autoOpen: false,
   buttons: {
       Ok: function() {
           $("#nameentered").text($("#name").val());
           $(this).dialog("close");
       },
       Cancel: function () {
           $(this).dialog("close");
       }
   }
});

$("#open").click(function () {
   $("#dialog").dialog("open");
});
Now normally, you can very easily do this in GameMaker by using the Asynchronous Dialogue (get_string_async). All built-in, very simple. It works well if you only want the user to input a single-line simple text. The keyboard on Android/iOS comes out natively, complete with the ability to select, copy, paste, basically everything that you would expect on a real HTML form input field. Only it doesn't work when you want to provide a text field say to write comments, messages, etc that gets sent to the server, since you only get one line of write-able field.

See it in action: http://jsfiddle.net/RBKaZ/

As I said before, it replicates the behavior of the native window.prompt() which GameMaker uses. So all that's left to do is to just wire them altogether using JS extensions on GM. You have to make a (JS) function to invoke it, then call it from within GM itself. On how to do this is a different case, you can try looking it up from here on how to work with javascript extensions.
 
Thank you, a nice explanation that might help future users that search for this topic.

Now that's out of the way, where do you think you are? Stack overflow? Is it edgelord material to ask that you give an explanation, after having taken the time to pose the question and then found the solution? Is asking for the answer a specifically GMC phenomena? Does it denigrate you as a coder to answer the question that was momentarily above you but is now clearly beneath you? I don't understand your hostility?
 

Carbon

Member
Thank you, a nice explanation that might help future users that search for this topic.

Now that's out of the way, where do you think you are? Stack overflow? Is it edgelord material to ask that you give an explanation, after having taken the time to pose the question and then found the solution? Is asking for the answer a specifically GMC phenomena? Does it denigrate you as a coder to answer the question that was momentarily above you but is now clearly beneath you? I don't understand your hostility?
Hostility? Excuse me? :p You should perhaps ask the shmug you're trying to defend. I've seen enough of his 4000's posts to see an abstraction of the real 'hostility' you're trying to describe.

No, definitely not a GMC phenomena to simply ask. It is, however, a GMC phenomena to simply ask without passive-aggressively provoke some aggression. When it's replied back with a joke like I did with 'Mr. Wanna-Be-Mod', things get ham 'n cheese all of a sudden. Why is that? You tell me.

Believe me had someone just said 'how?' or 'show me' I would've shown it right away. Still, I don't understand any of this fuss. Just because of the Mr. Wanna-Be-Mod mock? If I did not say that and simply replied with "already asked mods to delete" would there still be anyone here replying me?:p

You see someone just fooling around saying "Mr. Wanna-Be-Mod" now you get offended to the touch. That's real hilarious.
 
Honestly dude, from the very first post by someone other than you all that has been asked is an explanation of how you achieved what you did. Congrats on achieving it. It's useful to other members and I'm glad you posted the explanation. You seem to think there's a cabal of users taking things out of proportion, but what's really happening is a bunch of people who spend their free time helping people they can in their own way. Sometimes it -does- come with a side of condescension...Which, on reflection, does actually suck, but that's the nature of the internet. Maybe something you could do to counteract it is to participate in the board and give advice in the way you deem fit =) We can only ever build the world we want by participating in it in the way we want.
 

rIKmAN

Member
@Carbon
You've been here since 2016 and made almost 100 posts, it's not many but it's enough to know how a forum works and functions.

You've also seen "enough of my 4000 posts" that you have probably seen me saying the same thing to other selfish forum users who just take information and give nothing back to the community by announcing they solved their problem and leaving the thread for someone else to find and get no answer from.

The point is - you shouldn't have to be asked, and your first 2 posts in this thread are the very definition of useless and pointless.
I'm not sure which part of my response triggered you to be sarcastic as my request was genuine: either add the solution or get it deleted it as it's 100% useless.

It's literally you asking a question and then telling everyone you solved it with a "stick your tongue out" emoji - which may as well be a middle finger - and I'd love to hear how you think that is useful to anyone?
Also, if someone asked something like "how to draw text" and he quickly found the solution after having made a thread, I suppose no one would bother to ask the solution, why? Because it's so simple that it's not worth explaining.
Are you seriously comparing using draw_text() with setting up and integrating jQuery with GMS2?

You said yourself "This is the GMC" so you obviously spend enough time here to know that the majority of users are beginners to intermediate users who can often struggle with basic things like variable scoping, for loops or with blocks.
I did not know that this thread was worth explaining
Are you really saying that when it took you 2 paragraphs to explain, 2 code blocks of code most forum users won't recognise, the use / integration of a 3rd party JS library, use of the GMS2 Async Event and a link to another thread explaining how to create / use JS extensions and callbacks to get working?

Hardly explaining the how to use the x, y, and string arguments needed to use draw_text() is it?
If you're going to try and defend your self-centred, selfish behaviour at least try and use a story that is somewhat believable.

Lastly, if you want to address me feel free to do it directly, as for someone moaning about passive aggressiveness you sure do seem to be the one calling me names in this thread without me ever being the one you are actually talking to: "Mr Wanna-Be-Mod", "cactus", "edgy kid" and my favourite, "shmug". I appreciate the effort at variety if nothing else.

Note that I didn't name call or get personal at all in my reply to you, it was purely about the content of your post - or lack of it - but sure, I'm the hostile one.

Thanks for finally posting the explanation of your solution which may help others in future, even if it did have to be extracted from you rather then offered freely.

I hope it didn't hurt too much and hope it's something you can do on your own by default in future should the same thing happen where you find your own solution to a problem before anyone else has a chance to reply.

The less pointless / useless threads on the forum, the better for everyone.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, topic closed. The OP responded with a solution and there was no need for people to pile on after and attack them about it. Should he have posted the solution as well as saying "it's solved"? Yes, but once it was pointed out to them it they did, so that's the end of it.
 
Status
Not open for further replies.
Top