x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[BUG] UMG MouseButtonUp event only triggers on double click

I discovered the following bug while working with UMG in 4.18.1: You can reproduce it by following these steps:

  1. Create a new Blank Project without Starter Content

  2. Create Custom Game Mode and Pawn Blueprints.

  3. In World Settings, set your custom Game Mode as Default Game Mode

  4. In your Custom Game Mode, set your custom Pawn as Default Pawn

  5. Create an UMG Widget, add a Border element to its Canvas, Horizontal Fill, Vertical Fill, Size Y = 800, Brush Color Alpha = 0.2

  6. Bind on the OnMouseButtonUp-Event of the Border

  7. In the auto-generated, bound function, output some debug string message. Return Handled or Unhandled.

  8. Play in Editor and repeatedly click on the border, only double clicks will trigger the event.

Product Version: UE 4.18
Tags:
more ▼

asked Dec 02 '17 at 02:23 AM in Bug Reports

avatar image

birdfreeyahoo
870 46 44 80

avatar image birdfreeyahoo Dec 02 '17 at 02:28 AM

The same happens in standalone, and when overwriting the widgets Mouse Up event

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I bet you forgot to handle the mouse down first:

alt text

You can't expect MouseUp to fire otherwise.

capture.png (36.7 kB)
more ▼

answered Dec 02 '17 at 01:39 PM

avatar image

Everynone
13.8k 74 25 58

avatar image birdfreeyahoo Dec 02 '17 at 02:39 PM

Thank you that works, but breaks the functionality of my logic

avatar image Everynone Dec 02 '17 at 04:03 PM

That's unfortunate.

In case you can't find a satisfactory workaround, consider sharing some details regarding what you're trying to achieve. There might be alternatives available.

Good luck.

avatar image birdfreeyahoo Dec 02 '17 at 04:11 PM

I want a selection box in a RTS-like manner, so you drag a box and select units in it. That should not be possible on the whole screen, only where is no other UI. So I use a border to mark the area where this is possible. I need to unhandle mouse down, so normal single selection can take place also (which is in pawn logic, i know bad architecture). The problems are that 1. What this thread is about 2. That I need to click on that border first to get it focussed 3. OnMouseMove doesn't trigger while Mouse Button Down 4. Pointer Event -> GetScreenSpacePosition returns absolute coords (from OS desktop origin) which is bad for PIE or Windowed. Since drawing of the box occurs in a HUD-class and I pass the event information in my UMG Graph to this class (c++), I use VirtualDesktopToViewportPixel to convert it to viewport coords, but the conversion has no effect other than completely disabling any drawing (why ever).

I thought, since the mouse click is not realyy in a UI manner and is semantically linked to the in-game world, i catch the mouse events inside the pawn and pass it to the hud, completely omitting UMG. I will then have to find a possibility to only allow selection outside from UMG Widgets.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question