UMG and scroll wheel

Hi!

Our interface dedicates middle mouse button for clicking on menu buttons and using scroll-wheel to select-highlight consecutive menu items. I found it easy to use mouse and wheel input in character or controller blueprints, but can’t connect it to HUD buttons. Would greatly appreciate suggestion or perhaps relevant blueprint example.

Thanks!!!

My first draft:

  1. Get scroll wheel input in PlayerController and call custom event in Menu Widget’s blueprint.

  2. In Widget blueprint’s EventTick: MakeArray containing all buttons, iterate focus triggered by scroll wheel input, use SetColorAndOpacity to highlight active button, and middle-button click executes button’s function;

Am I on the right track, or is there more elegant solution that integrates with widget’s default behavior?

I think your on the right track but remember that by default custom player controllers block input from lower priority blueprints. I’m not a 100% sure if this works with widgets, but you can either

  1. Use Enable Input node when your widget is constructed (inside widget BP) to allow the use of player button inputs or;
  2. Go to your custom player controller and in Class Defaults change the Input setting to something other than Block

Hope this helps!

Ah ok. Didn’t see anything about VR help

Thanks, jtsmith - After some tinkering I made it all work smoothly both in desktop mode and with Oculus Rift VR: In 3D space mouse cursor is not practical, thus the mouse wheel … but I thought that continuously calling SetColorAndOpacity on every EventTick is too brutish, so instead we update SetColorAndOpacity on actual mouse and scroll-wheel events.