Event arguments used by clicked and handleClick.
Type Details
- yFiles module
- view
Constructors
ClickEventArgs
(context: IInputModeContext, location: Point, buttons: PointerButtons, clickCount: number, evt: PointerEventArgs)Initializes a new instance of the ClickEventArgs class.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context in which the click occurred.
- location - Point
- The location.
- buttons - PointerButtons
- The buttons.
- clickCount - number
- The number of clicks associated with this event.
- evt - PointerEventArgs
- The original pointer event args.
Properties
Gets the context for the current event.
Gets or sets a value indicating whether this instance has been handled.
Remarks
Client code that is triggered by the event and does not want the event to become handled by other handlers should set this property to true
to stop propagation of the event.
Note that this property needs to be set before the function synchronously returns. This means that setting the value in an async
function after the first await
or in an asynchronous callback, it cannot not be seen by the emitter of the event and the sender will consider the event as not being handled.
// wrong:
mode.addEventListener('item-clicked', async (evt) => {
await something()
evt.handled = true // will be set *after* all other event listeners have been invoked, only
})
// correct:
mode.addEventListener('item-clicked', async (evt) => {
evt.handled = true // will be set immediately and 'mode' will see the change
await something()
})
Property Value
true
if handled; false
otherwise.Gets the location of the click.
Property Value
Gets the state of the modifiers at the time of the click.
Property Value
Gets the pointer event args that caused this event.
Gets the PointerButtons that have changed for this event.
Gets the type of the pointer that was the source of this event.