|
|
@@ -189,21 +189,29 @@ public:
|
|
|
/// @param[in] x The x-coordinate of the mouse cursor, in window-coordinates (ie, 0 should be the left of the client area).
|
|
|
/// @param[in] y The y-coordinate of the mouse cursor, in window-coordinates (ie, 0 should be the top of the client area).
|
|
|
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together members of the Input::KeyModifier enumeration.
|
|
|
- void ProcessMouseMove(int x, int y, int key_modifier_state);
|
|
|
+ /// @return True if the mouse is not interacting with any elements in the context (see 'IsMouseInteracting'), otherwise false.
|
|
|
+ bool ProcessMouseMove(int x, int y, int key_modifier_state);
|
|
|
/// Sends a mouse-button down event into this context.
|
|
|
/// @param[in] button_index The index of the button that was pressed; 0 for the left button, 1 for right, and any others from 2 onwards.
|
|
|
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together members of the Input::KeyModifier enumeration.
|
|
|
- void ProcessMouseButtonDown(int button_index, int key_modifier_state);
|
|
|
+ /// @return True if the mouse is not interacting with any elements in the context (see 'IsMouseInteracting'), otherwise false.
|
|
|
+ bool ProcessMouseButtonDown(int button_index, int key_modifier_state);
|
|
|
/// Sends a mouse-button up event into this context.
|
|
|
/// @param[in] button_index The index of the button that was release; 0 for the left button, 1 for right, and any others from 2 onwards.
|
|
|
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together members of the Input::KeyModifier enumeration.
|
|
|
- void ProcessMouseButtonUp(int button_index, int key_modifier_state);
|
|
|
+ /// @return True if the mouse is not interacting with any elements in the context (see 'IsMouseInteracting'), otherwise false.
|
|
|
+ bool ProcessMouseButtonUp(int button_index, int key_modifier_state);
|
|
|
/// Sends a mouse-wheel movement event into this context.
|
|
|
/// @param[in] wheel_delta The mouse-wheel movement this frame. RmlUi treats a negative delta as up movement (away from the user), positive as down.
|
|
|
/// @param[in] key_modifier_state The state of key modifiers (shift, control, caps-lock, etc) keys; this should be generated by ORing together members of the Input::KeyModifier enumeration.
|
|
|
/// @return True if the event was not consumed (ie, was prevented from propagating by an element), false if it was.
|
|
|
bool ProcessMouseWheel(float wheel_delta, int key_modifier_state);
|
|
|
|
|
|
+ /// Returns a hint on whether the mouse is currently interacting with any elements in this context, based on previously submitted 'ProcessMouse...()' commands.
|
|
|
+ /// @note Interaction is determined irrespective of background and opacity. See the RCSS property 'pointer-events' to disable interaction for specific elements.
|
|
|
+ /// @return True if the mouse hovers over or has activated an element in this context, otherwise false.
|
|
|
+ bool IsMouseInteracting() const;
|
|
|
+
|
|
|
/// Gets the context's render interface.
|
|
|
/// @return The render interface the context renders through.
|
|
|
RenderInterface* GetRenderInterface() const;
|
|
|
@@ -258,7 +266,7 @@ private:
|
|
|
|
|
|
ContextInstancer* instancer;
|
|
|
|
|
|
- using ElementSet = SmallOrderedSet< Element* > ;
|
|
|
+ using ElementSet = SmallOrderedSet< Element* >;
|
|
|
using ElementList = Vector< Element* >;
|
|
|
// Set of elements that are currently in hover state.
|
|
|
ElementSet hover_chain;
|