Download

Set up Right Click on SButton

Can the SButton take right click events and not just left click


			SNew(SButton)
			.HAlign(HAlign_Fill)
			.VAlign(VAlign_Fill)
			.ButtonStyle(&InvStorage->EmptySlotButtonStyle)
			.OnClicked(this, &SItemWidget::RightClick)
			.ContentPadding(FMargin(0))

This can only detect left clicks and not right clicks.

It doesn’t look like you can get it to detect right clicks, I guess you’ll need to subclass SButton and override OnMouseButtonDown() and OnMouseButtonUp(). Or maybe add right click support directly to SButton and submit a pull request to Epic.

Never submitted a pull request yet but I am planning to right click support to SButton.