"consume mouse wheel" problem

Hello

i have a problem to change "consume mouse wheel " to be "never " Can you help me ?
Thanks so much !

exampel:

Hi Aliensa

You can set “Consume Mouse Wheel” directly in the details panel like this:

If you are creating the scroll box at run time, setting this requires a custom scroll box class. For some reason, the dev team never exposed a “Set Consume Mouse Wheel” function to blueprints, which means you cannot dynamically set it at run time.

To get around this, you can create a custom scroll box object, disable “Consume Mouse Wheel” by default, and use that object instead.

  1. In the content browser, right click → Selelct “New Blueprint Class”.

  2. Expose all classes and search for “Scroll Box”

  1. Open the widget class you have just created and set the default value for “ConsumeMouseWheel”

  2. Go back to your main widget blueprint graph. Instead of creating the normal scroll box, create an instance of your object instead. Right-click → Construct object from class → Select your custom class

272512-consumemousewheel-pt3.png

Do a simple print just to test:

272515-consumemousewheel-pt5.png

Note you can also use your custom scroll box in the widget designer as well. Just search for it in your pallet.

I hope this helps.

Good luck! :slight_smile:

1 Like

Thanks so much for the answer Alekann01 !

I really appreciate your great answer.
But i need to change the"Set Consume Mouse Wheel" dynamic .
For example in my level BP i have added “Any key” event .Also I have Widget with scrollBox with few buttons . If i use mouse wheel in the scrollBox i get key info from “Any Keys” only on the top and end of the scroll Box. But if i set “Set Consume Mouse Wheel” to be never and use scroll with mouse wheel i always getting key info from "Any Key " event .

BTW: I try to make key binds option in UE 4.14
And when i click on the button in the scrollBox i want “Any key” event to detect mouse wheel .

I hope all this make sens

Thanks alot !

Hi Aliensa

I have just had a look at the source code for the scroll box widget. The property is only applied when the widget is constructed or rebuilt, this is why they have made “ConsumeMouseWheel” read-only.

For the times where you don’t want the user to be able to scroll, you can set the widget visibility to “Self-Hit Test Invisible”, which will stop the scroll box from being seen by any input event. (You might need to ensure the scroll box isn’t focussed as well).

If you have created an event (“Any Keys”) which responds to any keyboard or mouse event fired, I think it will still get triggered regardless of your scroll box being enabled or not, however, I would need to see your setup for this to confirm 100%.

Play around with the visibility settings and see if you can get the results, but I strongly suspect you will need a workaround for your “Any Keys” event to not fire on MouseWheel inputs. If you’re still struggling, could you explain exactly what you’re trying to achieve, there might be a different approach I could suggest.

Good luck! :slight_smile:

Hi Aliensa. That’s great news!
Would you mind marking my answer as correct so other people can find this thread if they encounter the same problem.

Glad I could help. Good luck with the rest of your project! :slight_smile:

Hey Alekann01

Thanks again !
. I try some of the things that you recommended with the visibility and i get the result that i wanted .

Thanks so much