mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
This is a gigantic kerfuffle because Chromium expects a very specific directory & app bundle layout. Have to change a bunch of resource loading code to account for content development being launched from an app bundle, and also had to make automatic MSBuild tooling & a python script to generate such an app bundle
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using Robust.Client.Input;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Robust.Client.UserInterface
|
|
{
|
|
/// <summary>
|
|
/// Allows a control to listen for raw keyboard events. This allows bypassing the input binding system.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Raw key events are raised *after* keybindings and focusing has been calculated,
|
|
/// but before key bind events are actually raised.
|
|
/// This is necessary to allow UI system stuff to actually work correctly.
|
|
/// </remarks>
|
|
internal interface IRawInputControl
|
|
{
|
|
/// <param name="guiRawEvent"></param>
|
|
/// <returns>If true: all further key bind events should be blocked.</returns>
|
|
bool RawKeyEvent(in GuiRawKeyEvent guiRawEvent) => false;
|
|
// bool RawCharEvent(in GuiRawCharEvent guiRawCharEvent) => false;
|
|
}
|
|
|
|
/*
|
|
internal struct GuiRawCharEvent
|
|
{
|
|
// public readonly
|
|
public readonly RawKeyAction Action;
|
|
public readonly Vector2i MouseRelative;
|
|
public readonly Rune Char;
|
|
}
|
|
*/
|
|
|
|
internal readonly struct GuiRawKeyEvent
|
|
{
|
|
public readonly Keyboard.Key Key;
|
|
public readonly int ScanCode;
|
|
public readonly RawKeyAction Action;
|
|
public readonly Vector2i MouseRelative;
|
|
public readonly ushort RawCode;
|
|
|
|
public GuiRawKeyEvent(Keyboard.Key key, int scanCode, RawKeyAction action, Vector2i mouseRelative, ushort rawCode)
|
|
{
|
|
Key = key;
|
|
ScanCode = scanCode;
|
|
Action = action;
|
|
MouseRelative = mouseRelative;
|
|
RawCode = rawCode;
|
|
}
|
|
}
|
|
|
|
public enum RawKeyAction : byte
|
|
{
|
|
Down,
|
|
Repeat,
|
|
Up
|
|
}
|
|
}
|