From ed2edab72f64167c9da2ac9cbdcc5da2ddd8b810 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Wed, 21 Mar 2018 22:00:28 +0100 Subject: [PATCH] Added F for "Home" hotkey --- Scripts/Editor/NodeEditorAction.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index 0019e4c..7b43574 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -140,8 +140,12 @@ namespace XNodeEditor { } else if (!IsHoveringNode) { // If click outside node, release field focus if (!isPanning) { + // I've got no idea which of these do what, so we'll just reset all of it. GUIUtility.hotControl = 0; GUIUtility.keyboardControl = 0; + EditorGUIUtility.editingTextField = false; + EditorGUIUtility.keyboardControl = 0; + EditorGUIUtility.hotControl = 0; } AssetDatabase.SaveAssets(); } @@ -165,6 +169,10 @@ namespace XNodeEditor { isPanning = false; } break; + case EventType.KeyDown: + if (EditorGUIUtility.editingTextField) break; + else if (e.keyCode == KeyCode.F) Home(); + break; case EventType.ValidateCommand: if (e.commandName == "SoftDelete") RemoveSelectedNodes(); else if (e.commandName == "Duplicate") DublicateSelectedNodes();