Thread Tools Display Modes
08-28-18, 05:58 AM   #1
Basil2
An Aku'mai Servant
Join Date: Feb 2015
Posts: 30
How to detect that chat input is active?

If player has pressed enter key and start typing into chat - how can I detect this moment from addon?
  Reply With Quote
08-28-18, 09:09 AM   #2
LanceDH
A Cyclonian
 
LanceDH's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 41
There might be a different way, but you could hook into its OnEditFocusGained and OnEditFocusLost scripts.
Note that, if it loses focus by the player clicking another edit box, 'OnEditFocusLost' will trigger twice.

Lua Code:
  1. ChatFrame1EditBox:HookScript("OnEditFocusGained", function()
  2.             print("gained")
  3.         end)
  4.  
  5. ChatFrame1EditBox:HookScript("OnEditFocusLost", function()
  6.             print("lost")
  7.         end)
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » How to detect that chat input is active?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off