I know its possible to detect key events when the inspector window is selected, using a custom editor. ie:
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor(typeof(MyClass))]
public class MyClassEditor: Editor
{
public override void OnInspectorGUI()
{
// Draw Default Inspector
DrawDefaultInspector();
// Respond to key presses
if (Event.current.isKey)
{
Debug.Log("Key Pressed- lets do something!");
}
}
}
But is there a way to do this when the Hiearchy Window is in focus?