Widget handler: OnEnterPressed

From AddOn Studio
Revision as of 04:49, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page UIHANDLER OnEnterPressed to UIHANDLER OnEnterPressed without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Widget handlers < OnEnterPressed

Description[edit]

Icon-edit-22x22.png
Note: This is a generic section stub. You can help expand it by clicking Sprite-monaco-pencil.png Edit on the section title.

EditBox:OnEnterPressed()

Arguments[edit]

Icon-edit-22x22.png
Note: This is a generic section stub. You can help expand it by clicking Sprite-monaco-pencil.png Edit on the section title.

Example[edit]

Icon-edit-22x22.png
Note: This is a generic section stub. You can help expand it by clicking Sprite-monaco-pencil.png Edit on the section title.
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.