private void KeyboardControl()
{
if (InputManager.ReceivingInput != null)
{
return;
}
#region Escape for exit
if (InputManager.Keyboard.KeyPushed(Keys.Escape))
{
OkCancelWindow ocw = GuiManager.ShowOkCancelWindow("Exit ParticleEditor? Unsaved data will be lost", "Exit?");
ocw.OkClick += new GuiMessage(GuiData.Messages.ExitOk);
}
#endregion
#region press space to emit current emitter
if (InputManager.Keyboard.KeyPushed(Keys.Space) && AppState.Self.CurrentEmitter != null)
{
AppState.Self.CurrentEmitter.Emit(null);
}
#endregion
#region Ctrl + C for copying emitter
if ((InputManager.Keyboard.KeyDown(Keys.LeftControl) || InputManager.Keyboard.KeyDown(Keys.RightControl)) && InputManager.Keyboard.KeyPushed(Keys.C))
{
EditorData.CopyCurrentEmitter();
}
#endregion
#region pressing C to clear all particles
else if (InputManager.Keyboard.KeyPushed(Keys.C))
{
GuiData.ActivityWindow.ClearAllParticles();
}
#endregion
#region pressing delete to delete the current emitter
if (InputManager.Keyboard.KeyPushed(Keys.Delete))
{
DeleteCurrentEmitter();
}
#endregion
if (InputManager.Keyboard.KeyPushed(Keys.A))
{
GuiData.ToolsWindow.attachObject.Press();
}
if (InputManager.Keyboard.KeyPushed(Keys.M))
{
GuiData.ToolsWindow.moveObject.Press();
}
}