WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   How to detect that chat input is active? (https://www.wowinterface.com/forums/showthread.php?t=56612)

Basil2 08-28-18 05:58 AM

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?

LanceDH 08-28-18 09:09 AM

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)


All times are GMT -6. The time now is 09:42 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI