|
Gin
|
Mouse listener that uses std::function callbacks instead of virtual overrides. More...
#include <gin_asyncutilities.h>
Inherits juce::MouseListener.
Public Member Functions | |
| LambdaMouseListener ()=default | |
Public Attributes | |
| std::function< void(const juce::MouseEvent &)> | onMouseMove |
| std::function< void(const juce::MouseEvent &)> | onMouseEnter |
| std::function< void(const juce::MouseEvent &)> | onMouseExit |
| std::function< void(const juce::MouseEvent &)> | onMouseDown |
| std::function< void(const juce::MouseEvent &)> | onMouseDrag |
| std::function< void(const juce::MouseEvent &)> | onMouseUp |
| std::function< void(const juce::MouseEvent &)> | onMouseDoubleClick |
| std::function< void(const juce::MouseEvent &, const juce::MouseWheelDetails &)> | onMouseWheelMove |
| std::function< void(const juce::MouseEvent &, float)> | onMouseMagnify |
Mouse listener that uses std::function callbacks instead of virtual overrides.
LambdaMouseListener provides a convenient alternative to juce::MouseListener by accepting lambda functions for each mouse event type. This is particularly useful when adding a mouse listener to a component to monitor its child components, avoiding the "double event" problem where the component would receive both its own mouse events and the forwarded ones from being its own listener.
Key Features:
Available Callbacks:
Only assign callbacks for the events you need. Unassigned callbacks are safely ignored.
Usage:
|
default |
| std::function<void (const juce::MouseEvent&, const juce::MouseWheelDetails&)> LambdaMouseListener::onMouseWheelMove |