Is there any way to make an EditorWindow force keyboard/mouse focus onto the Scene View? I have some OnSceneGUI code that’s not being run, because when I click a button in the EditorWindow, it forces focus to that window.
What I’d like, is for whenever you press a window button, for the window to lose focus and bring the SceneView to the forefront, but I can’t seem to find any documentation on how to do that.
Any tips/pointers would be greatly appreciated. Thanks!
Thanks for the reply, but I’m not quite sure I understand. I’m not trying to move the camera, simply change the focused editor window.
Also, unless I’m wrong, I dont’ think Input.GetKey works very well in editor scripting, and the use of Events is used it its place. (Which is actually part of the reason I’m trying to do this - my Events won’t capture if the SceneView isn’t the focused window :P)
Yes, Editor Scripting. I’m making a custom tool in the editor - but my OnSceneGUI block isn’t being run properly when focus is on the EditorWindow, so I’d like to find a way to force focus on the Scene View.