WoW:UIHANDLER OnEnterPressed

From AddOn Studio
Revision as of 16:34, 11 December 2012 by WoWWiki>Asett (Created page with " EditBox:OnEnterPressed() EditBox:SetScript("OnEnterPressed", function(self) self:ClearFocus(); -- clears focus from editbox, (unlocks key bindings, so pressing W makes...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

EditBox:OnEnterPressed()

EditBox:SetScript("OnEnterPressed", function(self)
    self:ClearFocus(); -- clears focus from editbox, (unlocks key bindings, so pressing W makes your character go forward.
    ChatFrame1EditBox:SetFocus(); -- if this is provided, previous line is not needed (opens chat frame)
end;

If you want to open chat frame when pressing enter instead of adding a new line, then add this script to your EditBox frame.