Emulating a left mouse click with Gamepad

Hello, I’m trying to emulate a left mouse click using an input action that has the bottom face button assigned to it. I’m trying to trigger the On_Clicked event of buttons using the gamepad. I’m already able to move the mouse cursor around with the gamepad but I can’t find a way to trigger the On_Clicked event.

For reference, I’m using Unreal Engine 5.3 and am still a bit new when it comes to Unreal Engine, so I’m sorry if I’m missing something obvious.

Any luck? I’m struggling with this too.

id suggest just creating an interface that does the same thing and call that

How would one make this interface you’re referencing?

If using 5.3 why not use the new enhanced gameplay input this is literally what its for set the user action say click do something to use key binding mouse click and gamepad x key?

Are you saying that, with this enhanced input tool, we can have the “on clicked” event also translate to a gamepad button input? That’s the crux of the problem; it’s not just any old left-click that’s needed, it’s the left click associated with “on clicked” event.

Btw, might you know how to map cursor movement to a gamepad? I can’t find a tutorial for that that actually works (just posted up in the forums about this problem/a tutorial that only sort of works)

you can use the the enhanched input to trigger an onclicked event by binding the two together, and cursor movement to gamepad? what do you mean like a thumbstick to act as mouse cursor?

here is a quick link that can help with using enhanced user input The “pressed key” condition in the Enhanced input system - Programming & Scripting / Blueprint - Epic Developer Community Forums (unrealengine.com)

Yes, I mean mapping the left thumbstick to the cursor/vice versa for menu navigation purposes. None of the tutorials I’ve found thus far seem to work…

have you added the necessary blueprint node to use enhanced input

if you dont know what an interface is youtube will help, its pretty simple.

what i do is on click/button press i gethitresultundercursor, this will return an actor and then you call the interface on that actor

Okay, so I added an enhanced input that binds left click and a gamepad button, but I couldn’t find a way to specifically bind the generic “onclicked” event. And since this is a menu, I need it bound specifically to the generic “onclicked” event so that it can work for any of the 30 buttons on my menu and its various widgets. How do I get that set up? I feel like I’m close.

can you show how the enhanced input is set up in the menu blueprint?

maybe look at the vr template it has all this setup and you can see how they have done it in there

Where do I find this VR Template? And I just made a post showing my layout if you want to see it firsthand and advise from there: Trouble setting up joint gamepad-cursor “On Clicked” event - Development / Programming & Scripting - Epic Developer Community Forums (unrealengine.com)

create a new game project and select the VR template

Make sure you have the engine option (Templates and Feature Packs) enabled

This will allow you to use the Left Thump stick as mouse.