- I
Remarks
Clients register to clicked to get notified of pointer clicks.
This mode can be instructed to swallow clicks if they happen shortly after the control gained focus. This is useful to prevent accidental clicks from being processed if the user wanted to put the focus into the control, only.
This mode is exclusive by default.
Examples
ClickInputMode is installed as child mode of a GraphEditorInputMode or GraphViewerInputMode and can be retrieved from the clickInputMode property.const clickInputMode = mode.clickInputModeSee Also
Developer's Guide
API
- clickReportingPolicy, swallowFocusClick
Members
Constructors
Properties
Gets the location of the last click.
Gets or sets when the clicked event should be raised regarding single clicks.
See Also
Developer's Guide
API
- ClickReportingPolicy
Gets the installed controller.
Examples
mode.clickInputMode.enabled = falseThe value of this property will be delegated to the exclusive property of the controller.
If this mode is marked as exclusive and has the mutex, all other modes added to the same MultiplexingInputMode will be deactivated. Otherwise, it will always run concurrently with all other modes.
Retrieves the IInputModeContext this mode has been installed in.
null if this mode is currently not installed. Use createInputModeContext to obtain a context that has this IInputMode as the inputMode.Implements
IInputMode.priorityGets or sets whether to request the mutex on a click.
true this will discard other concurrent input modes on a click. The default is true.Gets or sets a property that determines whether clicks should be swallowed if they happen within a short amount of time after the CanvasComponent got focus.
false. If set to true, clicks are discarded within 100 ms after the focus entered.See Also
Developer's Guide
Gets or sets the cursor to use when hovering over a valid hit region.
null and the current cursor is used instead.Gets or sets a hit test that determines where this mode should recognize clicks.
Gets or sets a hit test that determines where this mode should recognize click events that were caused by touch input.
Methods
See Also
API
- onCanceled
Implements
IInputMode.cancelCreates an implementation of IInputModeContext that is specific to this mode.
This is needed for events that are triggered by this InputMode to signal where the event is coming from. A common usage for this is, for example, in isHit calls.
The result can be given to isHit or enumerateHits to let implementations of IHitTestable get access to the current IInputModeContext. This can be done by looking up IInputModeContext from the ICanvasContext's lookup method or simply downcasting.
Return Value
- IInputModeContext
- A readily configured IInputModeContext.
See Also
Installs this mode into the given context that is provided by the canvas.
In general a mode can only be installed into a single canvas at all times.
This method is called to initialize this instance. Subclasses should override this method to register the corresponding event handler delegates for the various input events they need to register with.
Overriding implementations should call the base implementation first.
Parameters
- context: IInputModeContext
- The context that this instance shall be installed into. The same instance will be passed to this instance during uninstall. A reference to the context may be kept and queried during the time the mode is installed.
- controller: ConcurrencyController
- The controller for this mode.
See Also
API
- uninstall
Implements
IInputMode.installCalled after cancel has been called.
Can be overridden in subclasses to perform additional actions after the mode has been canceled.
This implementation does nothing.
Called once this mode has recognized a click gesture.
Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should call the base implementation.
Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should call the base implementation.
Called after tryStop has been called.
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation does nothing.
falseReturn Value
- boolean
trueif and only if the editing has been stopped or there was no edit in progress
Implements
IInputMode.tryStopUninstalls this mode from the given context.
This code should clean up all changes made to the canvas in the install method. After a mode has been uninstalled it can be installed again into the same or another canvas.
Overriding implementations should call the base implementation after their own code.
Parameters
- context: IInputModeContext
- The context to deregister from. This is the same instance that had been passed to install during installation.
Implements
IInputMode.uninstallEvents
Occurs once a click or tap has been detected.
Properties of
ClickEventArgs- altKey: boolean
- Gets a value indicating whether the alt modifier was pressed at the time of the click.
- clickCount: number
- Gets the number of clicks associated with this event.
- context: IInputModeContext
- Gets the context for the current event.
- ctrlKey: boolean
- Gets a value indicating whether the control modifier was pressed at the time of the click.
- handled: booleanwritable
- Gets or sets a value indicating whether this instance has been handled.
- location: Point
- Gets the location of the click.
- metaKey: boolean
- Gets a value indicating whether the meta modifier was pressed at the time of the click.
- modifiers: ModifierKeys
- Gets the state of the modifiers at the time of the click.
- originalEventArgs: PointerEventArgs
- Gets the pointer event args that caused this event.
- pointerButtons: PointerButtons
- Gets the PointerButtons that have changed for this event.
- pointerType: PointerType
- Gets the type of the pointer that was the source of this event.
- shiftKey: boolean
- Gets a value indicating whether the shift modifier was pressed at the time of the click.
See Also
Developer's Guide
API
- ClickEventArgs, clickReportingPolicy