How to unfocus/disable editbox?

For questions about using Classic.

Post » Sat Feb 26, 2011 10:32 am

In my level editor I have an edit box, after I'm done using the editbox and start placing tiles again, I'll try and scroll the screen using WASD keys. However whenever I use the keyboard, the letters I press will keep being placed into the editbox even though I've clicked away from it before typing.

I tried using the "disable" and "focus off" actions for the editbox, but that prevents any keyboard input at all until I give the editbox focus again.

Editboxes are so annoying! Anyone have any ideas on what I could do?
B
4
S
1
G
1
Posts: 63
Reputation: 776

Post » Sat Feb 26, 2011 11:14 am

There is a solution here using python:
[url:2gwqz33i]http://www.scirra.com/forum/viewtopic.php?f=3&t=8082&p=62179&hilit=keyboard+focus#p62179[/url:2gwqz33i]
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Sat Feb 26, 2011 12:09 pm

Thanks.

I tried adding it the script in, but it gives an error. I don't really understand python.

B
4
S
1
G
1
Posts: 63
Reputation: 776

Post » Sat Feb 26, 2011 10:33 pm

Ctypes is a python library. Here is all the python files you need:
[url:1k0cvt8s]http://dl.dropbox.com/u/5426011/examples3/py.zip[/url:1k0cvt8s]
Don't unzip it, just put it in the same directory as your cap.

Then use this script:
[code:1k0cvt8s]sys.path.append(System.AppPath + 'py.zip')
from ctypes import *
windll.user32.SetFocus(Window.AppWindow)[/code:1k0cvt8s]
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Sun Feb 27, 2011 1:36 am

Even though you did that system.apppath thing, I think its looking for it somewhere else?

B
4
S
1
G
1
Posts: 63
Reputation: 776

Post » Sun Feb 27, 2011 2:01 am

Used this "trick" for an unrelated purpose, but it solves the problem without python, so figured I would post it.

http://www.mediafire.com/?fs5ezbonvywoyvd
B
13
S
6
G
6
Posts: 144
Reputation: 3,106

Post » Sun Feb 27, 2011 2:31 am

interesting idea, thanks
B
4
S
1
G
1
Posts: 63
Reputation: 776

Post » Fri Dec 23, 2011 4:48 pm

I'm sorry to wake up an old topic ^^ But I really need (buddy40)'s file.. I have problem with that editbox focux off. :( I handle that problem with minimize application and maximize again. But now I need to work on fullscreen so I can't use that method. Thank you..
B
7
S
1
G
1
Posts: 76
Reputation: 904

Post » Fri Dec 23, 2011 5:20 pm

Not sure what buddy40's cap did, but destroying the object works.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Dec 23, 2011 5:39 pm

fixed in the next build
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests