Add Spacebar to toggle play/pause in Audio Clip window
This commit is contained in:
@@ -335,6 +335,22 @@ namespace FlaxEditor.Windows.Assets
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnKeyDown(KeyboardKeys key)
|
||||
{
|
||||
if (base.OnKeyDown(key))
|
||||
return true;
|
||||
|
||||
if (key == KeyboardKeys.Spacebar)
|
||||
{
|
||||
if (_previewSource?.State == AudioSource.States.Playing)
|
||||
OnPause();
|
||||
else
|
||||
OnPlay();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool UseLayoutData => true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user