I have a UI InputField, and I want to be able to only let a message send when the enter key is pressed AND when the UI InputField has focus (as in the user can currently type in it, and isn't doing other actions).
How do I check if the UI InputField has focus?
I've been trying
uiInputField.GetComponent<Text>().IsActive()
But I don't think this is what I'm looking for (mostly because it doesn't do what I'm trying to get.)
Thanks in advance!
Edit: I wish to do this programmatically. (The UIInputField is created via code, rather than in Unity.) How would I go about doing this?