- Home /
Question by
Leggy7 · Sep 12, 2015 at 05:49 PM ·
guigui-buttonfocus
Drop focus from Button after click
I faced a really annoying situation.
I have a GUI with a Button that opens a panel, and also a shortkey from keyboard that does the same action.
What's happening is that after I click on the button it gets the focus from input and everytime I press the return or space key it triggers the OnClick
event attached to it unless I click anywhere else on the screen.
I tried to use the GUI.FocusControl(string s)
, giving it an empty string without success and I also found a question here from 2012 which gives an horrible workaround to this issue.
Is it possible that there is not a straight way to handle this? I just want to drop the focus on the element after being clicked which possibly does not involve Update calls or click simulation. Any chance?
Comment