Bypassing the Text bot eating inputs

0 favourites
  • 10 posts
From the Asset Store
Supports keyboard, mouse and gamepads. Supports several gamepads at once.
  • So, by default, events like "Up key is pressed" are not triggered while you have a Text bot selected. Ashley mentionned the reasonning behind it "This is by design, to prevent text input conflicting with game input.", in this post . I understand that, it's reasonnable. BUT, is there a (preferably simple hehe) way to situationally bypass it?

    I remember doing it before by hacking into the actual exported C2 javascript files T__T but you have to do that every time you export a new version.

    Any other, simpler solutions though?

  • Sh*t, I ran some tests, and actually, even with Javascript I can't seem to know how to go around it ... my original test used the Control key in conjunction with Enter, but I now realize that basically only Enter gets detected??

  • im not sure what is the exact problem? do u have a capx that represents the issue?

  • Hello gamecorps! What I'm trying to accomplish is ... ugh, okay, this might be a little hard to explain lol, apologies in advance.

    So I'm making a text-based platformer, where you have to type in commands such as "right" "jump" etc to get by. To do so, I use a text box that is always focused, and I detect the "Press key 'Enter'" to check the text and call the right functions.

    Now, what I'm trying to make is a kind of "Chat History States", which would allow you to press the Up key to scroll back into past commands that you've sent (those "Chat history states" are stored in an array, and they appear in the active text box as you scroll through them with the arrows).

    My code for the scrolling is functionnal, but the arrow keys press CANNOT be detected WHILE the text box is focused.

  • Um, I could upload a CAPX ... But do you actually understand? I'd rather not upload the capx unless I have to.

    The only thing I want to do is find a way to detect the "Up key is pressed" and "Down key is pressed" despite the textbox being focused.

  • Instead of using a real Textbox, you can use a text object acting like a textbox

    https://goo.gl/kiuyUo

  • try:

    textBoxArrows.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • try:

    textBoxArrows.capx

    Oh my god, I literally copy pasted your javascript into my project, renamed 2-3 things to match it and it straight up WORKED! Thank you so much, and frankly I'm amazed and very thankful that you'd take the time to make an actual capx for it and all! #stoked!

  • Instead of using a real Textbox, you can use a text object acting like a textbox

    https://goo.gl/kiuyUo

    Thanks, I'll take a look into it! Since the game is reaaaally based on text, I'm very opened to different solutions that offer more flexibility!

  • Wow, just, thanks again, I'm so happy haha

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)