diff --git a/Source/Editor/GUI/CurveEditor.cs b/Source/Editor/GUI/CurveEditor.cs index 22deec120..b93aedaf9 100644 --- a/Source/Editor/GUI/CurveEditor.cs +++ b/Source/Editor/GUI/CurveEditor.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.Linq; using FlaxEditor.CustomEditors; using FlaxEditor.GUI.ContextMenu; +using FlaxEditor.Options; using FlaxEngine; using FlaxEngine.GUI; @@ -926,34 +927,29 @@ namespace FlaxEditor.GUI if (base.OnKeyDown(key)) return true; - switch (key) + InputOptions options = Editor.Instance.Options.Options.Input; + if (options.SelectAll.Process(this)) + { + SelectAll(); + UpdateTangents(); + return true; + } + else if (options.Delete.Process(this)) { - case KeyboardKeys.Delete: RemoveKeyframes(); return true; - case KeyboardKeys.A: - if (Root.GetKey(KeyboardKeys.Control)) - { - SelectAll(); - UpdateTangents(); - return true; - } - break; - case KeyboardKeys.C: - if (Root.GetKey(KeyboardKeys.Control)) - { - CopyKeyframes(); - return true; - } - break; - case KeyboardKeys.V: - if (Root.GetKey(KeyboardKeys.Control)) - { - KeyframesEditorUtils.Paste(this); - return true; - } - break; } + else if (options.Copy.Process(this)) + { + CopyKeyframes(); + return true; + } + else if (options.Paste.Process(this)) + { + KeyframesEditorUtils.Paste(this); + return true; + } + return false; } diff --git a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs index cb781229f..87bcb9d10 100644 --- a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs +++ b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Text; using FlaxEditor.CustomEditors; using FlaxEditor.GUI.ContextMenu; +using FlaxEditor.Options; using FlaxEditor.Scripting; using FlaxEngine; using FlaxEngine.GUI; @@ -1268,33 +1269,28 @@ namespace FlaxEditor.GUI if (base.OnKeyDown(key)) return true; - switch (key) + InputOptions options = Editor.Instance.Options.Options.Input; + if (options.SelectAll.Process(this)) + { + SelectAll(); + return true; + } + else if (options.Delete.Process(this)) { - case KeyboardKeys.Delete: RemoveKeyframes(); return true; - case KeyboardKeys.A: - if (Root.GetKey(KeyboardKeys.Control)) - { - SelectAll(); - return true; - } - break; - case KeyboardKeys.C: - if (Root.GetKey(KeyboardKeys.Control)) - { - CopyKeyframes(); - return true; - } - break; - case KeyboardKeys.V: - if (Root.GetKey(KeyboardKeys.Control)) - { - KeyframesEditorUtils.Paste(this); - return true; - } - break; } + else if (options.Copy.Process(this)) + { + CopyKeyframes(); + return true; + } + else if (options.Paste.Process(this)) + { + KeyframesEditorUtils.Paste(this); + return true; + } + return false; }