About Store Forum Documentation Contact



Post Reply 
Set focus on text input.
Author Message
Agnostic Offline
Member

Post: #1
Set focus on text input.
How I can focus a textbox gui?

I have my GUI with:
window+=addtext .create(Rect_C(window.crect.w()/2.7, -0.67f, 0.6f, 0.06f),"").desc("CHAT MESSAGE.");

if(Kb.bp(KB_ENTER))
{
SET FOCUS HERE??

}


Thank u!
10-03-2011 06:41 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: Set focus on text input.
Code:
    if(Kb.bp(KB_ENTER)){
        addtext.activate();
    }
(This post was last modified: 10-03-2011 07:25 AM by Zervox.)
10-03-2011 07:25 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #3
RE: Set focus on text input.
Or:

Code:
addtext.kbSet();
10-03-2011 07:47 AM
Find all posts by this user Quote this message in a reply
Agnostic Offline
Member

Post: #4
RE: Set focus on text input.
Code:
if(Kb.bp(KB_ENTER)) {
        if (activachat){
            keyboard_disable=true;
            addtext.kbSet();
            
        } else {
            if (addtext() != ""){
                AddMessage("Msg");
            }
            keyboard_disable=false;
            addtext.deactivate();
            addtext.clear();
        }

        activachat = !activachat;
        
}

Its working, thanks!
10-03-2011 03:50 PM
Find all posts by this user Quote this message in a reply
Post Reply