I built a custom Inspector for my object, and I need to know what button the user presses and then assign that to a variable. That’s easy enough, but the problem is, I can’t eat the spacebar event. Whenever the user presses space, the Inspector maximizes (I do still capture the keypress for my object). I’m using Event.current.Use().
Is there some way to prevent the Editor from accepting shortcut keys temporarily, or is there another way to be sure the event is ignored?
My code is essentially:
function OnInspectorGUI {
// variables
if ( listeningForEvent MatchesConditions( Event.current ) ) {
AssignValue( Event.current ); // this is definitely running, since the object captures the spacebar
Event.current.Use(); // but then the Inspector maximizes even after this line :?
}
// display GUI
// possibly set listeningForEvent
}