Merge branch 'stefnotch-fix-disable-ctrl-w-ingame'

This commit is contained in:
2021-01-27 22:41:28 +01:00
2 changed files with 34 additions and 10 deletions
+27 -10
View File
@@ -143,7 +143,30 @@ namespace FlaxEditor.Options
{
var root = control.Root;
if (root.GetKeyDown(Key))
if (root.GetKey(Key))
{
if (Modifier1 == KeyboardKeys.None || root.GetKey(Modifier1))
{
if (Modifier2 == KeyboardKeys.None || root.GetKey(Modifier2))
{
return true;
}
}
}
return false;
}
/// <summary>
/// Processes this input binding to check if state matches.
/// </summary>
/// <param name="control">The input providing control.</param>
/// <returns>True if input has been processed, otherwise false.</returns>
public bool Process(Control control, KeyboardKeys key)
{
var root = control.Root;
if (key == Key)
{
if (Modifier1 == KeyboardKeys.None || root.GetKey(Modifier1))
{
@@ -435,16 +458,10 @@ namespace FlaxEditor.Options
for (int i = 0; i < _bindings.Count; i++)
{
var binding = _bindings[i].Binder(options);
if (binding.Key == key)
if (binding.Process(control, key))
{
if (binding.Modifier1 == KeyboardKeys.None || root.GetKey(binding.Modifier1))
{
if (binding.Modifier2 == KeyboardKeys.None || root.GetKey(binding.Modifier2))
{
_bindings[i].Callback();
return true;
}
}
_bindings[i].Callback();
return true;
}
}
+7
View File
@@ -387,6 +387,13 @@ namespace FlaxEditor.Windows
}
}
// Prevent closing the game window tab during a play session
if (Editor.StateMachine.IsPlayMode && Editor.Options.Options.Input.CloseTab.Process(this, key))
{
return true;
}
return base.OnKeyDown(key);
}