Merge branch 'inputfixes' of https://github.com/Withaust/FlaxEngine into Withaust-inputfixes

This commit is contained in:
Wojtek Figat
2023-06-09 14:08:04 +02:00
2 changed files with 23 additions and 29 deletions

View File

@@ -85,18 +85,18 @@ Keyboard* Input::Keyboard = nullptr;
Array<Gamepad*, FixedAllocation<MAX_GAMEPADS>> Input::Gamepads; Array<Gamepad*, FixedAllocation<MAX_GAMEPADS>> Input::Gamepads;
Action Input::GamepadsChanged; Action Input::GamepadsChanged;
Array<InputDevice*, InlinedAllocation<16>> Input::CustomDevices; Array<InputDevice*, InlinedAllocation<16>> Input::CustomDevices;
Input::CharDelegate Input::CharInput; Delegate<Char> Input::CharInput;
Input::KeyboardDelegate Input::KeyDown; Delegate<KeyboardKeys> Input::KeyDown;
Input::KeyboardDelegate Input::KeyUp; Delegate<KeyboardKeys> Input::KeyUp;
Input::MouseButtonDelegate Input::MouseDown; Delegate<const Float2&, MouseButton> Input::MouseDown;
Input::MouseButtonDelegate Input::MouseUp; Delegate<const Float2&, MouseButton> Input::MouseUp;
Input::MouseButtonDelegate Input::MouseDoubleClick; Delegate<const Float2&, MouseButton> Input::MouseDoubleClick;
Input::MouseWheelDelegate Input::MouseWheel; Delegate<const Float2&, float> Input::MouseWheel;
Input::MouseDelegate Input::MouseMove; Delegate<const Float2&> Input::MouseMove;
Action Input::MouseLeave; Action Input::MouseLeave;
Input::TouchDelegate Input::TouchDown; Delegate<const Float2&, int32> Input::TouchDown;
Input::TouchDelegate Input::TouchMove; Delegate<const Float2&, int32> Input::TouchMove;
Input::TouchDelegate Input::TouchUp; Delegate<const Float2&, int32> Input::TouchUp;
Delegate<StringView> Input::ActionTriggered; Delegate<StringView> Input::ActionTriggered;
Array<ActionConfig> Input::ActionMappings; Array<ActionConfig> Input::ActionMappings;
Array<AxisConfig> Input::AxisMappings; Array<AxisConfig> Input::AxisMappings;

View File

@@ -66,72 +66,66 @@ API_CLASS(Static) class FLAXENGINE_API Input
static Array<InputDevice*, InlinedAllocation<16>> CustomDevices; static Array<InputDevice*, InlinedAllocation<16>> CustomDevices;
public: public:
typedef Delegate<Char> CharDelegate;
typedef Delegate<KeyboardKeys> KeyboardDelegate;
typedef Delegate<const Float2&> MouseDelegate;
typedef Delegate<const Float2&, MouseButton> MouseButtonDelegate;
typedef Delegate<const Float2&, float> MouseWheelDelegate;
typedef Delegate<const Float2&, int32> TouchDelegate;
/// <summary> /// <summary>
/// Event fired on character input. /// Event fired on character input.
/// </summary> /// </summary>
static CharDelegate CharInput; API_EVENT() static Delegate<Char> CharInput;
/// <summary> /// <summary>
/// Event fired on key pressed. /// Event fired on key pressed.
/// </summary> /// </summary>
static KeyboardDelegate KeyDown; API_EVENT() static Delegate<KeyboardKeys> KeyDown;
/// <summary> /// <summary>
/// Event fired on key released. /// Event fired on key released.
/// </summary> /// </summary>
static KeyboardDelegate KeyUp; API_EVENT() static Delegate<KeyboardKeys> KeyUp;
/// <summary> /// <summary>
/// Event fired when mouse button goes down. /// Event fired when mouse button goes down.
/// </summary> /// </summary>
static MouseButtonDelegate MouseDown; API_EVENT() static Delegate<const Float2&, MouseButton> MouseDown;
/// <summary> /// <summary>
/// Event fired when mouse button goes up. /// Event fired when mouse button goes up.
/// </summary> /// </summary>
static MouseButtonDelegate MouseUp; API_EVENT() static Delegate<const Float2&, MouseButton> MouseUp;
/// <summary> /// <summary>
/// Event fired when mouse button double clicks. /// Event fired when mouse button double clicks.
/// </summary> /// </summary>
static MouseButtonDelegate MouseDoubleClick; API_EVENT() static Delegate<const Float2&, MouseButton> MouseDoubleClick;
/// <summary> /// <summary>
/// Event fired when mouse wheel is scrolling (wheel delta is normalized). /// Event fired when mouse wheel is scrolling (wheel delta is normalized).
/// </summary> /// </summary>
static MouseWheelDelegate MouseWheel; API_EVENT() static Delegate<const Float2&, float> MouseWheel;
/// <summary> /// <summary>
/// Event fired when mouse moves. /// Event fired when mouse moves.
/// </summary> /// </summary>
static MouseDelegate MouseMove; API_EVENT() static Delegate<const Float2&> MouseMove;
/// <summary> /// <summary>
/// Event fired when mouse leaves window. /// Event fired when mouse leaves window.
/// </summary> /// </summary>
static Action MouseLeave; API_EVENT() static Action MouseLeave;
/// <summary> /// <summary>
/// Event fired when touch action begins. /// Event fired when touch action begins.
/// </summary> /// </summary>
static TouchDelegate TouchDown; API_EVENT() static Delegate<const Float2&, int32> TouchDown;
/// <summary> /// <summary>
/// Event fired when touch action moves. /// Event fired when touch action moves.
/// </summary> /// </summary>
static TouchDelegate TouchMove; API_EVENT() static Delegate<const Float2&, int32> TouchMove;
/// <summary> /// <summary>
/// Event fired when touch action ends. /// Event fired when touch action ends.
/// </summary> /// </summary>
static TouchDelegate TouchUp; API_EVENT() static Delegate<const Float2&, int32> TouchUp;
public: public:
/// <summary> /// <summary>