-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unfocussing still gives sounds #16
Comments
Hi, in my game I have simple function which tells me if mouse is over UI or not. If it's not over UI i Clear Focus every frame (after UpdateInput of ui root). |
Isn't that something we'd rather have EmptyKeys handle itself? I think it should do something that if you click outside of the UI and it unfocusses everything untill you click in the UI again. Could we build something like that inside EmptyKeys? |
I will write it down and think about it, if there is a good way to do it. |
If you have an update for this let me know :). Maybe something like this would work:
I think doing something like this makes the whole UI stuff very intuïtive and wouldn't need custom work from consumers of the library. |
I'm currently working on a 2d multiplayer game with chat functionality. I just used this stackoverflow post to create an IsFocussed extension:
https://stackoverflow.com/a/7972361/1149816
However I'm now trying to implement something that if you click out of the chat box that no commands are being sent to the UI anymore. I keep hearing all kinds of pops and sound effects and also the UI is still responding to arrow presses. This also happens when I use the InputManager.Current.ClearFocus() method. For some reason the next update loop the GamePlayUI is set as the focussed element again.
Is there any way to completely clear the focus of the EmptyKeys library?
I've created a video of this problem:
https://youtu.be/J001tU1ZucI
Incase you're wondering, the code that executes when you press enter or the Send button:
The text was updated successfully, but these errors were encountered: