Using A Control Causes Me To Lose Focus

For questions about using Classic.

Post » Fri Jan 09, 2009 6:44 pm

I am trying to make a sample platformer to learn Construct. The platformer behavior made it pretty easy to get a character running around and jumping over terrain.

My problem starts when I create a button control object. If I click on the button, my character becomes unresponsive to keyboard commands. If I minimize and restore the window, I can move the character again. Is there some way to give focus back to the character after the button is clicked?

In the changelog for 0.98 it says:
"- [FIX] Mouse & Keyboard: issues with focus (now focusing a control won't stop input; focusing another window will stop input)"

That sounds like the problem I'm having, but I'm running V0.98.3, so that should be fixed.

I have the same problem when I use any control (button, listBox, comboBox). By the way, when the button is clicked, all it does is increment a private variable of the character. That part seems to be working just fine.

Thanks for any help!
B
4
G
3
Posts: 21
Reputation: 942

Post » Fri Jan 09, 2009 7:40 pm

I thought I fixed this. Can you upload a .cap demonstrating the problem?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Fri Jan 09, 2009 7:57 pm

Platformer with Buttons

Thanks for your response!I hope this link works properly.

When you start the game, you can run around and jump normally, but after you click either button, the arrow keys don't move the character around any more.

It's probably better to click on the "More Jumps" button, since if you reduce the number of jumps to 0, the character won't jump.

Maybe it's something the in the event script I made that's causing trouble. I'll blank out the code for the button presses and see if I still have the problem.

Thanks again for your help
B
4
G
3
Posts: 21
Reputation: 942

Post » Sun Jan 11, 2009 6:29 pm

Hey don't sweat it. I lose focus all the time. I recommend coffee.
B
3
S
2
G
4
Posts: 271
Reputation: 2,017


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests