C

QueryClosestHandleEventArgs

Event argument that can be used to query the IHandle that is closest to the given location in world coordinate space.

Members

Show:

Constructors

Initializes a new instance of the QueryClosestHandleEventArgs class.

Parameters

context: IInputModeContext
The context of the query.
queryLocation: Point
The query location.

Properties

Gets the context for the current event.
readonlyfinal

Property Value

The context.
Gets or sets the handle to use.
Setting this property will set the handled property to true.
final

Property Value

The handle or null if no handle was close to the queryLocation.
Gets or sets a value indicating whether this QueryClosestHandleEventArgs instance has been handled.

If this property is set to true, the content of the handle property will be used as currentHandle. Otherwise, the input mode will continue determining the closest handle at the current queryLocation.

Handlers which handle this QueryClosestHandleEventArgs should always test first, whether this property is set to true and, if so, exit without doing anything.

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('query-closest-handle', async (evt) => {
  await something()
  evt.handled = true // will be set *after* all other event listeners have been invoked, only
})

// correct:
mode.addEventListener('query-closest-handle', async (evt) => {
  evt.handled = true // will be set immediately and 'mode' will see the change
  await something()
})
final

Property Value

true if handled; false otherwise.
Gets the query location in world coordinates.
readonlyfinal

Property Value

The query location.