WoW:UIHANDLER OnEnterPressed: Difference between revisions
Jump to navigation
Jump to search
(Created page with " EditBox:OnEnterPressed() EditBox:SetScript("OnEnterPressed", function(self) self:ClearFocus(); -- clears focus from editbox, (unlocks key bindings, so pressing W makes...") |
m (Move page script moved page UIHANDLER OnEnterPressed to UIHANDLER OnEnterPressed without leaving a redirect) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Stub/API}} | |||
{{widgethandler}}<br> | |||
== Description == | |||
{{sectionstub}} | |||
EditBox:OnEnterPressed() | EditBox:OnEnterPressed() | ||
== Arguments == | |||
{{sectionstub}} | |||
== Example == | |||
{{sectionstub}} | |||
EditBox:SetScript("OnEnterPressed", function(self) | EditBox:SetScript("OnEnterPressed", function(self) | ||
self:ClearFocus(); -- clears focus from editbox, (unlocks key bindings, so pressing W makes your character go forward. | 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) | ChatFrame1EditBox:SetFocus(); -- if this is provided, previous line is not needed (opens chat frame) | ||
end; | 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. | If you want to open chat frame when pressing enter instead of adding a new line, then add this script to your EditBox frame. | ||
Latest revision as of 04:49, 15 August 2023
← Widget handlers < OnEnterPressed
Description
EditBox:OnEnterPressed()
Arguments
Example
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.
