From 8c0c6c0142be09f6245a2a6b24390cc87bd32f27 Mon Sep 17 00:00:00 2001 From: Withaust Date: Thu, 8 Jun 2023 01:24:38 +0300 Subject: [PATCH] Expose some Input class delegates to scripting API --- Source/Engine/Input/Input.cpp | 22 +++++++++++----------- Source/Engine/Input/Input.h | 30 ++++++++++++------------------ 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/Source/Engine/Input/Input.cpp b/Source/Engine/Input/Input.cpp index 1fa7454ea..22969c752 100644 --- a/Source/Engine/Input/Input.cpp +++ b/Source/Engine/Input/Input.cpp @@ -85,18 +85,18 @@ Keyboard* Input::Keyboard = nullptr; Array> Input::Gamepads; Action Input::GamepadsChanged; Array> Input::CustomDevices; -Input::CharDelegate Input::CharInput; -Input::KeyboardDelegate Input::KeyDown; -Input::KeyboardDelegate Input::KeyUp; -Input::MouseButtonDelegate Input::MouseDown; -Input::MouseButtonDelegate Input::MouseUp; -Input::MouseButtonDelegate Input::MouseDoubleClick; -Input::MouseWheelDelegate Input::MouseWheel; -Input::MouseDelegate Input::MouseMove; +Delegate Input::CharInput; +Delegate Input::KeyDown; +Delegate Input::KeyUp; +Delegate Input::MouseDown; +Delegate Input::MouseUp; +Delegate Input::MouseDoubleClick; +Delegate Input::MouseWheel; +Delegate Input::MouseMove; Action Input::MouseLeave; -Input::TouchDelegate Input::TouchDown; -Input::TouchDelegate Input::TouchMove; -Input::TouchDelegate Input::TouchUp; +Delegate Input::TouchDown; +Delegate Input::TouchMove; +Delegate Input::TouchUp; Delegate Input::ActionTriggered; Array Input::ActionMappings; Array Input::AxisMappings; diff --git a/Source/Engine/Input/Input.h b/Source/Engine/Input/Input.h index 1fcb352ea..84d312fa3 100644 --- a/Source/Engine/Input/Input.h +++ b/Source/Engine/Input/Input.h @@ -66,72 +66,66 @@ API_CLASS(Static) class FLAXENGINE_API Input static Array> CustomDevices; public: - typedef Delegate CharDelegate; - typedef Delegate KeyboardDelegate; - typedef Delegate MouseDelegate; - typedef Delegate MouseButtonDelegate; - typedef Delegate MouseWheelDelegate; - typedef Delegate TouchDelegate; /// /// Event fired on character input. /// - static CharDelegate CharInput; + API_EVENT() static Delegate CharInput; /// /// Event fired on key pressed. /// - static KeyboardDelegate KeyDown; + API_EVENT() static Delegate KeyDown; /// /// Event fired on key released. /// - static KeyboardDelegate KeyUp; + API_EVENT() static Delegate KeyUp; /// /// Event fired when mouse button goes down. /// - static MouseButtonDelegate MouseDown; + API_EVENT() static Delegate MouseDown; /// /// Event fired when mouse button goes up. /// - static MouseButtonDelegate MouseUp; + API_EVENT() static Delegate MouseUp; /// /// Event fired when mouse button double clicks. /// - static MouseButtonDelegate MouseDoubleClick; + API_EVENT() static Delegate MouseDoubleClick; /// /// Event fired when mouse wheel is scrolling (wheel delta is normalized). /// - static MouseWheelDelegate MouseWheel; + API_EVENT() static Delegate MouseWheel; /// /// Event fired when mouse moves. /// - static MouseDelegate MouseMove; + API_EVENT() static Delegate MouseMove; /// /// Event fired when mouse leaves window. /// - static Action MouseLeave; + API_EVENT() static Action MouseLeave; /// /// Event fired when touch action begins. /// - static TouchDelegate TouchDown; + API_EVENT() static Delegate TouchDown; /// /// Event fired when touch action moves. /// - static TouchDelegate TouchMove; + API_EVENT() static Delegate TouchMove; /// /// Event fired when touch action ends. /// - static TouchDelegate TouchUp; + API_EVENT() static Delegate TouchUp; public: ///