Textbox Focus vs. Keyboard Workaround?

Get help using Construct 2

Post » Sun Jan 17, 2016 3:18 am

I'm trying to add a chat system to my game and I have a "if Right Arrow down" event to move my character. I also have a "on Return pressed" to bring up the chatbox.

The problem I'm having is when I hold "Right arrow down" and press "Return" to bring up the chatbox, I force the character to stop in its current position. However, when I press "Return" again to send the message and close the chat box, the character automatically runs right even though no button is being pressed (as if once you are focused on the textbox, it ignores you releasing a key and keeps it down).

Is there any way around this?
B
30
S
7
G
1
Posts: 504
Reputation: 3,341

Post » Sun Jan 17, 2016 2:01 pm

Can you post an mcve?
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Sun Jan 17, 2016 5:31 pm

https://dl.dropboxusercontent.com/u/281 ... Issue.capx

Here's a quick thing I put together. Just hold right arrow and press Return.
B
30
S
7
G
1
Posts: 504
Reputation: 3,341

Post » Mon Jan 18, 2016 5:56 pm

Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Mon Jan 18, 2016 7:28 pm

@briggybros - thanks for this, but if you add "set focused" back on return pressed, it doesn't solve the issue. I think this is just an HTML thing. The only workaround I can think of is to make it so you can open the textbox only when not moving.

Thank you, though!
B
30
S
7
G
1
Posts: 504
Reputation: 3,341


Return to How do I....?

Who is online

Users browsing this forum: mekonbekon and 10 guests