Object picker

Object picker is a component that allows an entity to interact with the mouse pointer. This component does not interact with the previously described input API directly. For example, you don't need to provide a mouse device for it. All you need to do is to attach the ObjectPicker component to an entity that also contains a mesh. The signals from ObjectPicker will notify you about input events related to this entity:

Signal Explanation
clicked(pick) The object was clicked.
pressed(pick) The mouse button was pressed over the object.
released(pick) The mouse button was released after pressed(pick) was triggered.
moved(pick) The mouse pointer was moved.
entered() The mouse pointer entered the object's area.
exited() ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.