diff --git a/Source/ImGui/Private/ImGuiInputPreprocessor.cpp b/Source/ImGui/Private/ImGuiInputPreprocessor.cpp deleted file mode 100644 index 19dae20..0000000 --- a/Source/ImGui/Private/ImGuiInputPreprocessor.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "ImGuiInputPreprocessor.h" diff --git a/Source/ImGui/Private/ImGuiInputPreprocessor.h b/Source/ImGui/Private/ImGuiInputPreprocessor.h deleted file mode 100644 index f02265d..0000000 --- a/Source/ImGui/Private/ImGuiInputPreprocessor.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once - -#include "ImGuiModuleManager.h" -#include "Framework/Application/IInputProcessor.h" - -class FImGuiModuleManager; - -class FImGuiInputPreprocessor : public IInputProcessor -{ -public: - FImGuiInputPreprocessor(FImGuiModuleManager& InModuleManager) - : ModuleManager(InModuleManager) - { - } - - virtual void Tick(const float DeltaTime, FSlateApplication& SlateApp, TSharedRef Cursor) override - { - } - - virtual bool HandleKeyDownEvent(FSlateApplication& SlateApp, const FKeyEvent& InKeyEvent) override - { - return false; - } - - virtual bool - HandleAnalogInputEvent(FSlateApplication& SlateApp, const FAnalogInputEvent& InAnalogInputEvent) override - { - return false; - } - - virtual bool HandleMouseMoveEvent(FSlateApplication& SlateApp, const FPointerEvent& InPointerEvent) override - { -/* - const bool bIsWindowHovered = ImGui::IsWindowHovered(); - FImGuiContextProxy* Proxy = ModuleManager.GetContextManager().GetContextProxy(0); - if (Proxy) - { - GEngine->AddOnScreenDebugMessage(10, 0, Proxy->WantsMouseCapture() ? FColor::Green : FColor::Red, TEXT("Move Capture")); - } - else - { - GEngine->AddOnScreenDebugMessage(10, 0, FColor::Red, TEXT("No proxy")); - } - - GEngine->AddOnScreenDebugMessage(1, 0, bIsWindowHovered ? FColor::Green : FColor::Red, TEXT("Move Hover")); - */ - return false; - } - - virtual bool HandleMouseButtonDownEvent(FSlateApplication& SlateApp, const FPointerEvent& InPointerEvent) override - { - //if (ModuleManager.GetProperties().IsMouseInputShared()) - if (false) { - FImGuiContextProxy* Proxy = ModuleManager.GetContextManager().GetContextProxy(0); - const bool bWantsCapture = Proxy ? Proxy->WantsMouseCapture() : false; - const bool bIsWindowHovered = ImGui::IsWindowHovered(); - GEngine->AddOnScreenDebugMessage(2, 10, bIsWindowHovered ? FColor::Green : FColor::Red, TEXT("InputPreproc: Click Hover")); - GEngine->AddOnScreenDebugMessage(3, 10, bWantsCapture ? FColor::Green : FColor::Red, TEXT("InputPreproc: Wants capture")); - return bWantsCapture; - } - return false; - } - - virtual bool - HandleMouseButtonDoubleClickEvent(FSlateApplication& SlateApp, const FPointerEvent& InPointerEvent) override - { - return false; - } - - virtual const TCHAR* GetDebugName() const override { return TEXT("CommonInput"); } - -private: - bool IsRelevantInput(FSlateApplication& SlateApp, const FInputEvent& InputEvent) - { - return false; - } - - FImGuiModuleManager& ModuleManager; -}; diff --git a/Source/ImGui/Private/ImGuiModule.cpp b/Source/ImGui/Private/ImGuiModule.cpp index 1f4b64e..b5fabcb 100644 --- a/Source/ImGui/Private/ImGuiModule.cpp +++ b/Source/ImGui/Private/ImGuiModule.cpp @@ -4,7 +4,6 @@ #include "ImGuiDelegatesContainer.h" #include "ImGuiModuleManager.h" -#include "ImGuiInputPreprocessor.h" #include "TextureManager.h" #include "Utilities/WorldContext.h" #include "Utilities/WorldContextIndex.h" @@ -132,9 +131,6 @@ void FImGuiModule::StartupModule() checkf(!ImGuiModuleManager, TEXT("Instance of the ImGui Module Manager already exists. Instance should be created only during module startup.")); ImGuiModuleManager = new FImGuiModuleManager(); - ImGuiInputPreprocessor = MakeShared(*ImGuiModuleManager); - FSlateApplication::Get().RegisterInputPreProcessor(ImGuiInputPreprocessor, 0); - #if WITH_EDITOR checkf(!ImGuiEditor, TEXT("Instance of the ImGui Editor already exists. Instance should be created only during module startup.")); ImGuiEditor = new FImGuiEditor(); diff --git a/Source/ImGui/Public/ImGuiModule.h b/Source/ImGui/Public/ImGuiModule.h index 813a5a8..b0315e5 100644 --- a/Source/ImGui/Public/ImGuiModule.h +++ b/Source/ImGui/Public/ImGuiModule.h @@ -177,8 +177,6 @@ public: virtual void ShutdownModule() override; private: - TSharedPtr ImGuiInputPreprocessor; - #if WITH_EDITOR virtual void SetProperties(const FImGuiModuleProperties& Properties); struct FImGuiContextHandle* ImGuiContextHandle = nullptr;