Skip to content

ClickSimComponent (Unreal Engine, C++). Simulate a left mouse click at the current cursor when pressing Gamepad A.

Notifications You must be signed in to change notification settings

ZeroBreakpoint/ClickSimComponent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

ClickSimComponent (Unreal Engine, C++)

This small class creates a component to attach to Player Controllers within Unreal Engine. Its purpose is to simulate a left mouse click at the current mouse cursor when pressing Gamepad A.
Prevents UMG from consuming the A-press by registering a Slate input preprocessor, then fires a real pointer click at the cursor. Includes widget-only mode, by setting bRequireHoveredWidget to true.

SetEnabled and SetDisabled functions that can be called from within engine to turn this simulate on and off.

Install (drop-in source)

  1. Copy:
  • Source/YourProject/Public/ClickSimComponent.h
  • Source/YourProject/Private/ClickSimComponent.cpp
  1. In <YourProject>.Build.cs add:
PublicDependencyModuleNames.AddRange(new[]{
  "Core","CoreUObject","Engine","InputCore","Slate","SlateCore","UMG","ApplicationCore"
});

About

ClickSimComponent (Unreal Engine, C++). Simulate a left mouse click at the current cursor when pressing Gamepad A.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages