| 194 | |
| 195 | /// <inheritdoc /> |
| 196 | public override bool OnKeyDown(KeyboardKeys key) |
| 197 | { |
| 198 | if (base.OnKeyDown(key)) |
| 199 | return true; |
| 200 | |
| 201 | // Fallback to the owning window for shortcuts |
| 202 | EditorWindow editorWindow = null; |
| 203 | ContainerControl c = Parent; |
| 204 | while (c != null && editorWindow == null) |
| 205 | { |
| 206 | editorWindow = c as EditorWindow; |
| 207 | c = c.Parent; |
| 208 | } |
| 209 | var editor = Editor.Instance; |
| 210 | if (editorWindow == null) |
| 211 | editorWindow = editor.Windows.EditWin; // Fallback to main editor window |
| 212 | return editorWindow.InputActions.Process(editor, this, key); |
| 213 | } |
| 214 | } |
| 215 | } |