openshot-audio  0.1.5
Classes | Public Member Functions | List of all members
MouseInactivityDetector Class Reference

#include <juce_MouseInactivityDetector.h>

Inheritance diagram for MouseInactivityDetector:
Timer MouseListener

Classes

class  Listener
 

Public Member Functions

 MouseInactivityDetector (Component &target)
 
 ~MouseInactivityDetector ()
 
void setDelay (int newDelayMilliseconds) noexcept
 
void setMouseMoveTolerance (int pixelsNeededToTrigger) noexcept
 
void addListener (Listener *listener)
 
void removeListener (Listener *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.

Constructor & Destructor Documentation

◆ MouseInactivityDetector()

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.

◆ ~MouseInactivityDetector()

MouseInactivityDetector::~MouseInactivityDetector ( )

Destructor.

Member Function Documentation

◆ addListener()

void MouseInactivityDetector::addListener ( Listener listener)

Registers a listener.

◆ removeListener()

void MouseInactivityDetector::removeListener ( Listener listener)

Removes a previously-registered listener.

◆ setDelay()

void MouseInactivityDetector::setDelay ( int  newDelayMilliseconds)
noexcept

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

◆ setMouseMoveTolerance()

void 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.


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