Files
RobustToolbox/Robust.Client/GameController/GameController.Input.cs
T
Pieter-Jan BriersandGitHub cf2995437f Remove Godot support. (#805)
Let's be real, it's pretty damn broken already and will never be fixed.
2019-05-05 01:58:24 +02:00

78 lines
2.4 KiB
C#

using Robust.Client.Input;
namespace Robust.Client
{
internal sealed partial class GameController
{
/// <summary>
/// Invoked when a key on the keyboard is pressed down.
/// </summary>
public void KeyDown(KeyEventArgs keyEvent)
{
_userInterfaceManager.KeyDown(keyEvent);
if (keyEvent.Handled)
{
return;
}
_inputManager.KeyDown(keyEvent);
}
/// <summary>
/// Invoked when a key on the keyboard is released.
/// </summary>
public void KeyUp(KeyEventArgs keyEvent)
{
// Unlike KeyDown, InputManager still gets key ups.
// My logic is that it should be fine dealing with redundant key ups and this *might* prevent edge cases.
_userInterfaceManager.KeyUp(keyEvent);
_inputManager.KeyUp(keyEvent);
}
public void TextEntered(TextEventArgs textEvent)
{
_userInterfaceManager.TextEntered(textEvent);
}
/// <summary>
/// Invoked when a button on the mouse is pressed down.
/// </summary>
public void MouseDown(MouseButtonEventArgs mouseEvent)
{
_userInterfaceManager.MouseDown(mouseEvent);
_stateManager.MouseDown(mouseEvent);
}
/// <summary>
/// Invoked when a button on the mouse is released.
/// </summary>
public void MouseUp(MouseButtonEventArgs mouseButtonEventArgs)
{
_userInterfaceManager.MouseUp(mouseButtonEventArgs);
_stateManager.MouseUp(mouseButtonEventArgs);
}
/// <summary>
/// Invoked when the mouse is moved inside the game window.
/// </summary>
public void MouseMove(MouseMoveEventArgs mouseMoveEventArgs)
{
_userInterfaceManager.MouseMove(mouseMoveEventArgs);
_stateManager.MouseMove(mouseMoveEventArgs);
}
/// <summary>
/// Invoked when the mouse wheel is moved.
/// </summary>
public void MouseWheel(MouseWheelEventArgs mouseWheelEventArgs)
{
_userInterfaceManager.MouseWheel(mouseWheelEventArgs);
if (mouseWheelEventArgs.Handled)
{
return;
}
_stateManager.MouseWheelMove(mouseWheelEventArgs);
}
}
}