JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
juce::MouseInactivityDetector Class Reference

This object watches for mouse-events happening within a component, and if the mouse remains still for long enough, triggers an event to indicate that it has become inactive. More...

#include "juce_MouseInactivityDetector.h"

Inheritance diagram for juce::MouseInactivityDetector:
juce::Timer juce::MouseListener

Classes

class  Listener
 Classes should implement this to receive callbacks from a MouseInactivityDetector when the mouse becomes active or inactive. More...
 

Public Member Functions

 MouseInactivityDetector (Component &target)
 Creates an inactivity watcher, attached to the given component.
 
 ~MouseInactivityDetector () override
 Destructor.
 
void setDelay (int newDelayMilliseconds) noexcept
 Sets the time for which the mouse must be still before the callback is triggered.
 
void setMouseMoveTolerance (int pixelsNeededToTrigger) noexcept
 Sets the number of pixels by which the cursor is allowed to drift before it is considered to be actively moved.
 
void addListener (Listener *listener)
 Registers a listener.
 
void removeListener (Listener *listener)
 Removes a previously-registered listener.
 

Detailed Description

This object watches for mouse-events happening within a component, and if the mouse remains still for long enough, triggers an event to indicate that it has become inactive.

You'd use this for situations where e.g. you want to hide the mouse-cursor when the user's not actively using the mouse.

After creating an instance of this, use addListener to get callbacks when the activity status changes.

@tags{GUI}

Definition at line 43 of file juce_MouseInactivityDetector.h.

Constructor & Destructor Documentation

◆ MouseInactivityDetector()

juce::MouseInactivityDetector::MouseInactivityDetector ( Component target)

Creates an inactivity watcher, attached to the given component.

The target component must not be deleted while this - it will be monitored for any mouse events in it or its child components.

Definition at line 29 of file juce_MouseInactivityDetector.cpp.

◆ ~MouseInactivityDetector()

juce::MouseInactivityDetector::~MouseInactivityDetector ( )
override

Destructor.

Definition at line 34 of file juce_MouseInactivityDetector.cpp.

Member Function Documentation

◆ addListener()

void juce::MouseInactivityDetector::addListener ( Listener listener)

Registers a listener.

Definition at line 42 of file juce_MouseInactivityDetector.cpp.

◆ removeListener()

void juce::MouseInactivityDetector::removeListener ( Listener listener)

Removes a previously-registered listener.

Definition at line 43 of file juce_MouseInactivityDetector.cpp.

◆ setDelay()

void juce::MouseInactivityDetector::setDelay ( int  newDelayMilliseconds)
noexcept

Sets the time for which the mouse must be still before the callback is triggered.

Definition at line 39 of file juce_MouseInactivityDetector.cpp.

◆ setMouseMoveTolerance()

void juce::MouseInactivityDetector::setMouseMoveTolerance ( int  pixelsNeededToTrigger)
noexcept

Sets the number of pixels by which the cursor is allowed to drift before it is considered to be actively moved.

Definition at line 40 of file juce_MouseInactivityDetector.cpp.


The documentation for this class was generated from the following files: