21 lines
653 B
C#
21 lines
653 B
C#
using Engine.Core;
|
|
|
|
namespace Engine.Systems.Input;
|
|
|
|
public interface IButtonInputs<T> : IHasStateEnable
|
|
{
|
|
InputEvent OnAnyButtonPressed { get; }
|
|
InputEvent OnAnyButtonReleased { get; }
|
|
|
|
void RegisterOnPress(T button, InputEvent.EventHandler callback);
|
|
void UnregisterOnPress(T button, InputEvent.EventHandler callback);
|
|
void RegisterOnRelease(T button, InputEvent.EventHandler callback);
|
|
void UnregisterOnRelease(T button, InputEvent.EventHandler callback);
|
|
|
|
bool IsPressed(T button);
|
|
|
|
readonly record struct ButtonCallbackArguments(T Button);
|
|
|
|
class InputEvent : Event<IButtonInputs<T>, ButtonCallbackArguments>;
|
|
}
|