x


TextField eats all keys as of 3.4.0

This code appears to no longer work:

unity3d.com - GUI.GetNameOfFocusedControl documentation (uses Return key to confirm a text field as alternative to a button)

It seems now that TextField eats all keys (even releasing of Shift and Ctrl, messing up their states).

Any ideas for workarounds? This is making my game unusable every time I show a TextField. Is there some new input method support or something that I can turn off to maybe avoid whatever added this bug?

more ▼

asked Jul 28 '11 at 04:39 AM

Waz gravatar image

Waz
6.5k 23 33 71

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I found Input.eatKeyPressOnTextFieldFocus:

Input.eatKeyPressOnTextFieldFocus = false;

Since TextField doesn't even correctly restore state of CTRL, you basically have to do this if you use Shift or Ctrl state in your game.

more ▼

answered Jul 28 '11 at 04:46 AM

Waz gravatar image

Waz
6.5k 23 33 71

How do you use it in a script??? In a Awake function, i wrote " Input.eatKeyPressOnTextFieldFocus = false; ", but i get an error: BCE0019: 'eatKeyPressOnTextFieldFocus' is not a member of 'UnityEngine.Input'.

Aug 03 '11 at 01:52 PM Tuor

Yes, just set it once in one object's Awake function. Are you using 3.4.0?

Aug 03 '11 at 01:59 PM Waz

No... 3.3

Aug 03 '11 at 02:19 PM Tuor

I just tried in 3.4, and it works fine now.

Aug 03 '11 at 02:22 PM Tuor
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x529
x156
x2

asked: Jul 28 '11 at 04:39 AM

Seen: 2027 times

Last Updated: Aug 03 '11 at 02:22 PM