window settings - imgui toggle input settings

This commit is contained in:
Arnaud Jamin
2023-10-11 14:34:18 -04:00
parent 18d82287aa
commit e90b097c1d
12 changed files with 310 additions and 77 deletions
@@ -85,16 +85,15 @@ bool FCogImguiInputHelper::WasKeyInfoJustPressed(APlayerController& PlayerContro
{
if (PlayerController.WasInputKeyJustPressed(KeyInfo.Key))
{
if (UPlayerInput* PlayerInput = PlayerController.PlayerInput.Get())
{
const bool MatchCtrl = IsCheckBoxStateMatchingValue(KeyInfo.Ctrl, PlayerInput->IsCtrlPressed());
const bool MatchAlt = IsCheckBoxStateMatchingValue(KeyInfo.Alt, PlayerInput->IsAltPressed());
const bool MatchShift = IsCheckBoxStateMatchingValue(KeyInfo.Shift, PlayerInput->IsShiftPressed());
const bool MatchCmd = IsCheckBoxStateMatchingValue(KeyInfo.Cmd, PlayerInput->IsCmdPressed());
const FModifierKeysState& ModifierKeys = FSlateApplication::Get().GetModifierKeys();
const bool Result = MatchCtrl && MatchAlt && MatchShift && MatchCmd;
return Result;
}
const bool MatchCtrl = IsCheckBoxStateMatchingValue(KeyInfo.Ctrl, ModifierKeys.IsControlDown());
const bool MatchAlt = IsCheckBoxStateMatchingValue(KeyInfo.Alt, ModifierKeys.IsAltDown());
const bool MatchShift = IsCheckBoxStateMatchingValue(KeyInfo.Shift, ModifierKeys.IsShiftDown());
const bool MatchCmd = IsCheckBoxStateMatchingValue(KeyInfo.Cmd, ModifierKeys.IsCommandDown());
const bool Result = MatchCtrl && MatchAlt && MatchShift && MatchCmd;
return Result;
}
return false;
@@ -5,7 +5,7 @@
#include "CogImGuiKeyInfo.generated.h"
USTRUCT()
struct FCogImGuiKeyInfo
struct COGIMGUI_API FCogImGuiKeyInfo
{
GENERATED_BODY()