ScottPlot
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
ScottPlot.Interactivity.UserInputProcessor Class Reference

This class collects user inputs and performs responses to manipulate a Plot. Custom user input actions may be supplied, and the list of responses can be modified to achieve total control over interaction behavior. More...

Public Member Functions

void Enable ()
 Enable processing of user input events.
 
void Disable ()
 Disable processing of user input events. Effectively makes this control non-interactive.
 
 UserInputProcessor (IPlotControl plotControl)
 
void RemoveAll< T > ()
 Remove all user input responses of the specified type.
 
void Reset ()
 Resets the user input responses to use the default interactivity settings.
 
static List< IUserActionResponse > new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.void DoubleLeftClickBenchmark (bool enable)
 Helper method to enable or disable the default double-left-click benchmark behavior.
 
void LeftClickDragPan (bool enable, bool horizontal=true, bool vertical=true)
 Helper method to enable or disable the default left-click-drag pan behavior.
 
void RightClickDragZoom (bool enable, bool horizontal=true, bool vertical=true)
 Helper method to enable or disable the default left-click-drag pan behavior.
 
void Process (IUserAction userAction)
 Process a user input and return results of the responses that engaged with it.
 
void ProcessLostFocus ()
 

Static Public Member Functions

static List< IUserActionResponseDefaultUserResponses ()
 Default user actions that are in place when the event processor is constructed or reset.
 
static void ResetState (IPlotControl plotControl)
 Reset state of all user action responses to do things like abort mouse-down-drag actions or key press-and-hold actions.
 

Public Attributes

readonly KeyboardState KeyState = new()
 Tracks which keys are currently pressed.
 
readonly List< IUserActionResponseUserActionResponses = []
 A list of user input responses that processes all incoming events in order. Users may manipulate this list to change the default behavior and add custom behaviors.
 
Action< IPlotControlLostFocusAction
 

Properties

IPlotControl PlotControl [get]
 The plot this input processor will act on.
 
bool IsEnabled [get, set]
 Controls whether new events are processed. Enabling this disables the older IPlotControl.Interaction system.
 

Detailed Description

This class collects user inputs and performs responses to manipulate a Plot. Custom user input actions may be supplied, and the list of responses can be modified to achieve total control over interaction behavior.

Constructor & Destructor Documentation

◆ UserInputProcessor()

ScottPlot.Interactivity.UserInputProcessor.UserInputProcessor ( IPlotControl  plotControl)
inline

Member Function Documentation

◆ DefaultUserResponses()

static List< IUserActionResponse > ScottPlot.Interactivity.UserInputProcessor.DefaultUserResponses ( )
static

Default user actions that are in place when the event processor is constructed or reset.

◆ Disable()

void ScottPlot.Interactivity.UserInputProcessor.Disable ( )

Disable processing of user input events. Effectively makes this control non-interactive.

◆ DoubleLeftClickBenchmark()

static List< IUserActionResponse > new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.new UserActionResponses.void ScottPlot.Interactivity.UserInputProcessor.DoubleLeftClickBenchmark ( bool  enable)
inline

Helper method to enable or disable the default double-left-click benchmark behavior.

◆ Enable()

void ScottPlot.Interactivity.UserInputProcessor.Enable ( )

Enable processing of user input events.

◆ LeftClickDragPan()

void ScottPlot.Interactivity.UserInputProcessor.LeftClickDragPan ( bool  enable,
bool  horizontal = true,
bool  vertical = true 
)
inline

Helper method to enable or disable the default left-click-drag pan behavior.

◆ Process()

void ScottPlot.Interactivity.UserInputProcessor.Process ( IUserAction  userAction)
inline

Process a user input and return results of the responses that engaged with it.

◆ ProcessLostFocus()

void ScottPlot.Interactivity.UserInputProcessor.ProcessLostFocus ( )
inline

◆ RemoveAll< T >()

void ScottPlot.Interactivity.UserInputProcessor.RemoveAll< T > ( )
inline

Remove all user input responses of the specified type.

Type Constraints
T :IUserActionResponse 

◆ Reset()

void ScottPlot.Interactivity.UserInputProcessor.Reset ( )
inline

Resets the user input responses to use the default interactivity settings.

◆ ResetState()

static void ScottPlot.Interactivity.UserInputProcessor.ResetState ( IPlotControl  plotControl)
inlinestatic

Reset state of all user action responses to do things like abort mouse-down-drag actions or key press-and-hold actions.

◆ RightClickDragZoom()

void ScottPlot.Interactivity.UserInputProcessor.RightClickDragZoom ( bool  enable,
bool  horizontal = true,
bool  vertical = true 
)
inline

Helper method to enable or disable the default left-click-drag pan behavior.

Member Data Documentation

◆ KeyState

readonly KeyboardState ScottPlot.Interactivity.UserInputProcessor.KeyState = new()

Tracks which keys are currently pressed.

◆ LostFocusAction

Action<IPlotControl> ScottPlot.Interactivity.UserInputProcessor.LostFocusAction
Initial value:
= (IPlotControl plotControl) =>
{
ResetState(plotControl);
plotControl.Refresh();
}
static void ResetState(IPlotControl plotControl)
Reset state of all user action responses to do things like abort mouse-down-drag actions or key press...
Definition UserInputProcessor.cs:187

◆ UserActionResponses

readonly List<IUserActionResponse> ScottPlot.Interactivity.UserInputProcessor.UserActionResponses = []

A list of user input responses that processes all incoming events in order. Users may manipulate this list to change the default behavior and add custom behaviors.

Property Documentation

◆ IsEnabled

bool ScottPlot.Interactivity.UserInputProcessor.IsEnabled
getset

Controls whether new events are processed. Enabling this disables the older IPlotControl.Interaction system.

◆ PlotControl

IPlotControl ScottPlot.Interactivity.UserInputProcessor.PlotControl
get

The plot this input processor will act on.


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