Files
RobustToolbox/Robust.Client/Interfaces/Input/IInputManager.cs
ShadowCommander a8d6c294ab Input System Refactor (#840)
* Fixes right click menu stopping input

Removed a flag change when the modal stack was showing, which preventing the click from getting passed to the next function.

* Added parsing for mod2 and mod3 from Keybind YAML

* Fixes a crash on context change when a keybind is not defined in keybinds.yml

* Implemented ShowDebugConsole Hotkey

* Refactored input system

Refactored input system to run Key and Mouse input through the InputManager before doing stuff.

* Upgraded LineEdit and classes that use it. Fixed input while KeyboardFocused.

Upgraded LineEdit to use Keybinds.
Upgraded DebugConsole to use Keybinds.
Replaced all references to MouseDown, MouseUp, KeyDown, and KeyUp with KeyBindUp and KeyBindDown.
Moved UserInterfaceManager call from GameController.Input to InputManager event.
Stopped input going to simulation while a control has focus in UserInterfaceManager.

* Some fixes for input system

Fixed keybinds getting stuck when selecting a LineEdit.
Changed MenuBar to not error.
Fixed a few cases where LineEdit would eat input if you hovered over it and where mouse input got eaten when clicking in the world while a LineEdit was selected.

* Removed extra dependencies

* Added GUIBoundKeyEventArgs to ButtonEventArgs

* Fixes for input with LineEdit selected

Fixed multiple keybinds mapped to the same key not triggering.
Fixed keybind input not getting to LineEdit when hovering over a control.

* Implemented Key Repeat for LineEdit

* Fix for input on Robust.Lite Launcher

* Renames NonFocusKeybinds to EnableAllKeybinds

Renamed NonFocusKeybinds to EnableAllKeybinds and added comment to clarify usage

* Adds repeating keybinds

Used for TextBackspace, TextCursorLeft, and TextCursorRight
Reverts a change to LineEdit that implemented repeating keys
Adds some documentation comments
2019-08-21 17:13:48 +02:00

61 lines
2.0 KiB
C#

using Robust.Shared;
using Robust.Shared.IoC;
using System;
using Robust.Client.Input;
using Robust.Shared.Maths;
using Robust.Shared.Input;
namespace Robust.Client.Interfaces.Input
{
/// <summary>
/// Manages key bindings, input commands and other misc. input systems.
/// </summary>
public interface IInputManager
{
bool Enabled { get; set; }
Vector2 MouseScreenPosition { get; }
BoundKeyMap NetworkBindMap { get; }
IInputContextContainer Contexts { get; }
void Initialize();
/// <summary>
/// Adds the Use keybind for Keyboard.Key.MouseLeft for Robust.Lite Launcher.
/// </summary>
void AddClickBind();
void KeyDown(KeyEventArgs e);
void KeyUp(KeyEventArgs e);
/// <summary>
/// Gets a key binding according to the function it is bound to.
/// </summary>
/// <param name="function">The function the key binding is bound to.</param>
/// <returns>The key binding.</returns>
IKeyBinding GetKeyBinding(BoundKeyFunction function);
bool TryGetKeyBinding(BoundKeyFunction function, out IKeyBinding binding);
/// <summary>
/// Returns the input command bound to a key function.
/// </summary>
/// <param name="function">The key function to find the bound input command for.</param>
/// <returns>An input command, if any. Null if no command is set.</returns>
InputCmdHandler GetInputCommand(BoundKeyFunction function);
void SetInputCommand(BoundKeyFunction function, InputCmdHandler cmdHandler);
/// <summary>
/// UIKeyBindStateChanged is called when a keybind is found.
/// </summary>
event Action<BoundKeyEventArgs> UIKeyBindStateChanged;
/// <summary>
/// If UIKeyBindStateChanged did not handle the BoundKeyEvent, KeyBindStateChanged is called.
/// </summary>
event Action<BoundKeyEventArgs> KeyBindStateChanged;
}
}