0

The problem is just like what I explained in Title. After InputField user input, all the other character(such as KeyCode.A, KeyCode.B, ... KeyCode.Z) input seems not working for GetKeyDown(), GetKeyUp(), GetKey(), while special keys works such as KeyCode.LeftArrow, KeyCode.Delete, etc.

void Update(){
    // search shortcut with Enter key     
    if (Input.GetKeyDown(KeyCode.Return))
    {
        if (searchField.text.Trim() != "")
        {
            // do something
        }
        searchField.DeactivateInputField();
    }
}

After some search, I found DeactivateInputField() function and I executed in the end of if statement to prevent it. But it seems helpful but sometimes not. I mean, after insert searchField.DeactivateInputField(); sometimes this problem doesn't occur, sometimes it occurs. I am lost..

I am guessing InputField event system is eating keys but only character keys.. I can't use Input.eatKeyPressOnTextFieldFocus because I'm using Unity5 and it is deprecated.

Any help?

Myeong-jae Kim
  • 133
  • 3
  • 11
  • Possible duplicate of [how make to make ios keyboard's return key submit input in unity?](http://stackoverflow.com/questions/31803135/how-make-to-make-ios-keyboards-return-key-submit-input-in-unity) – Fattie Feb 03 '16 at 04:02
  • It's not really that easy to do this. Example http://stackoverflow.com/questions/29670276/how-to-detect-done-button-in-softkeyboard-unity3d But note that you really **don't use** Input.GetKeyDown with UI ! ... just keep reading the .text of the InputField – Fattie Feb 03 '16 at 04:04
  • Like this .. http://stackoverflow.com/a/29112180/294884 and this http://stackoverflow.com/a/28293066/294884 – Fattie Feb 03 '16 at 04:06
  • Thank you for your time. But I don't think it's related to my problem. How is it related? I am not asking how to make return key has submit effect. I already implement it. I'm asking something like bug which character buttons are not working after return key. – Myeong-jae Kim Feb 04 '16 at 01:51

0 Answers0