Flush Event Queue discards both the Mouse Down and the Mouse Up events regardless of the event source. However, because a constant value of 1 is wired to the keep most recent parameter, the function keeps one of the most recent Mouse Down or Mouse Up events in the event queue. Furthermore, the function keeps only one event total rather than one event for each event type.
You can wire a VI Server reference that points to an object that generates an event, a user event refnum, and any refnum with associated events to the event type or object input to discard only the events generated by a specific objects. To discard events from multiple objects, use an array or cluster of refnums, as shown in the following example.
Flush Event Queue discards any type of event generated by the objects linked to the references that are bundled in the cluster.
If you want to discard an event only when a specific object generates that event, you can bundle an enum that contains the event type you want to discard with a refnum that points to the object that generates that event. You also can create a cluster or array of event type enum/object pairs to discard multiple events associated with multiple objects, as shown in the following example.
The function discards the Mouse Up or Mouse Down events only when the Boolean generates those events. |
The function discards the Mouse Move event only when the 2D Picture control generates that event. | |
Because the event is not paired with a specific object, the function discards the Key Up event when any event source generates that event. |