Table of Contents

Class UserInputProcessor

Namespace
ScottPlot.Interactivity
Assembly
ScottPlot.dll

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.

public class UserInputProcessor
Inheritance
UserInputProcessor
Inherited Members
Extension Methods

Constructors

UserInputProcessor(IPlotControl)

public UserInputProcessor(IPlotControl plotControl)

Parameters

plotControl IPlotControl

Fields

KeyState

Tracks which keys are currently pressed

public readonly KeyboardState KeyState

Field Value

KeyboardState

LostFocusAction

public Action<IPlotControl> LostFocusAction

Field Value

Action<IPlotControl>

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.

public readonly List<IUserActionResponse> UserActionResponses

Field Value

List<IUserActionResponse>

Properties

IsEnabled

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

public bool IsEnabled { get; set; }

Property Value

bool

PlotControl

The plot this input processor will act on

public IPlotControl PlotControl { get; }

Property Value

IPlotControl

Methods

DefaultUserResponses()

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

public static List<IUserActionResponse> DefaultUserResponses()

Returns

List<IUserActionResponse>

Disable()

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

public void Disable()

DoubleLeftClickBenchmark(bool)

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

public void DoubleLeftClickBenchmark(bool enable)

Parameters

enable bool

Enable()

Enable processing of user input events.

public void Enable()

LeftClickDragPan(bool, bool, bool)

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

public void LeftClickDragPan(bool enable, bool horizontal = true, bool vertical = true)

Parameters

enable bool
horizontal bool
vertical bool

Process(IUserAction)

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

public void Process(IUserAction userAction)

Parameters

userAction IUserAction

ProcessLostFocus()

public void ProcessLostFocus()

RemoveAll<T>()

Remove all user input responses of the specified type

public void RemoveAll<T>() where T : IUserActionResponse

Type Parameters

T

Reset()

Resets the user input responses to use the default interactivity settings

public void Reset()

ResetState(IPlotControl)

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

public static void ResetState(IPlotControl plotControl)

Parameters

plotControl IPlotControl

RightClickDragZoom(bool, bool, bool)

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

public void RightClickDragZoom(bool enable, bool horizontal = true, bool vertical = true)

Parameters

enable bool
horizontal bool
vertical bool