Thread: EditBox control
View Single Post
05/11/14, 04:42 PM   #8
Nabren
Join Date: Feb 2014
Posts: 7
Originally Posted by Aicam View Post
You need to tell the edit box when it should get focus. The following should be the normal behaviour of an edit box.
Code:
<OnMouseDown>
    self:TakeFocus()
</OnMouseDown>
<OnEnter>
    self:LoseFocus()
</OnEnter>
<OnEscape>
    self:LoseFocus()
</OnEscape>
I don't think the text attribute works and most of the others should be the default values.
That was it! Thank you. The focus still seems to get stuck, even after pressing escape or enter, the focus is properly lost on the EditBox control, but doesn't seem to be properly restored to the game. After the edit box gains focus, no matter how it loses focus, I have to end task because the keyboard fails to work. I can't even press escape to open the main game menu or get a mouse cursor to reload UI at that point.

Am I supposed to set the focus back to a different object so the character can continue to move, etc? Seems weird that an add-on can break the game that badly.

Regardless, this has definitely set me on the right path, I appreciate it!
  Reply With Quote