How do I bind OnKeyDown

I know that now 4.4 is out everyone is using the UMG, but unfortunately I don’t have that option with the team I’m working with, so I have a slate question.

According to the API SButton(and others) have an OnKeyDown function for handling keyboard events. Perhaps I’m not doing it right, but I can’t seem to get access to this in declarative syntax like I can with OnClicked or OnMouseButtonDown(for images etc). Am I suppose to create a widget class that inherits from SButton/SImage or others in order to handle keyboard input?

Well as see in API refrence it seems so, but i would tell he same for OnClicked and OnMouseButtonDown

Hi Apieron,

Slate widgets encapsulate capability and don’t expose more than is necessary for specific widget type. For example, buttons don’t expose anything more than OnClick because that’s all buttons do. If you need to handle things like mouse movement, keys…etc. You would just make a new slate widget that contains some number of child widgets using the SCompoundWidget. There you can override any of the virtual event functions sent to widgets by slate. We’ve been discussing offering an event monitoring system to Slate for UMG in the future, where you can observe any event on any widget, but not interfere (handle) the event.

Cheers,
Nick

Excellent. Thank you for the response, it’s good to know I’m on the right track.