Static Methods Relevant to DXMEvent Objects



andEvent

Creates an event that occurs only when the two given events happen simultaneously. The event time for the new event is when both of the given events occur.

public static DXMEvent andEvent(
  DXMEvent first,
  DXMEvent second
  );

Parameters
first and second
The DXMEvent objects.
Return Values

Returns a DXMEvent object. When the event occurs, it produces a PairObject. The first member is the event data returned by the first event. The second member is the event data returned by the second event.


keyDown

Returns an DXMEvent when a specific key is pressed. This is a state-transition event.

public static DXMEvent keyDown(
  int keyCode
  );

Parameters
keyCode
Can either be quoted characters such as 'a' or specific Java keycode constants.
Return Values

Returns the DXMEvent object. This event produces no data.


keyUp

Returns an DXMEvent when a specific key is released. This is a state-transition event.

public static DXMEvent keyUp(
  int keyCode
  );

Parameters
keyCode
Can either be quoted characters such as 'a' or specific Java keycode constants.
Return Values

Returns the DXMEvent object. This event produces no data.


notEvent

Creates an event that occurs when the given event does not occur. This is useful for creating combined events that occur only if the given event is not also occurring, for example, an event that occurs when the left mouse button is down and the right button is not down.

public static DXMEvent notEvent(
  DXMEvent ev
  );

Parameters
ev
The DXMEvent object.
Return Values

Returns the DXMEvent object. This event produces no data.


orEvent

Creates an event that occurs when either one of the given events occur. The event time for the new event is when either the first or second given event has occurred.

public static DXMEvent orEvent(
  DXMEvent first,
  DXMEvent second
  );

Parameters
first and second
The DXMEvent objects.
Return Values

Returns a DXMEvent object. Its data is the event data of either the first or second event.


predicate

Creates an event that occurs when the value of the given Boolean behavior changes from false to true. Note that, because of implementation dependencies and the potential for aliasing, the system cannot always detect when a Boolean behavior becomes true. For example, the expression: predicate(eq(sin(localTime), toBvr(0))) may never occur unless the system happens to sample it when sin(localTime)is exactly zero. Therefore, it is advisable to use inequality comparisons (for example, gte) rather than equality comparisons (for example, eq). Alternatively, the timer constructor may be a better choice for these situations.

public static DXMEvent predicate(
  BooleanBvr bool
  );

Parameters
bool
The BooleanBvr object.
Return Values

Returns the DXMEvent. This event produces no data.


thenEvent

Creates an event if e2 occurs after e1. The event time of the new event is the time of the second event.

public static DXMEvent thenEvent(
  DXMEvent e1,
  DXMEvent e2
  );

Parameters
e1
The first event, that, when it occurs, triggers the second event.
e2
The second event, caused by the occurrence of the first event.
Return Values

Returns the DXMEvent object. Its event data is the time the second event fired and a PairObject containing the event data for both events.


timer

Creates an event that occurs when the specified time has elapsed.

public static DXMEvent timer(
  NumberBvr timeout
  );

Parameters
timeout
The NumberBvr object. This parameter can also be of type double.
Return Values

Returns the DXMEvent object. This event produces no data.


unregisterCallback

Used to unregister the callback.

public static void unregisterCallback(
  Object object
  );

Parameters
object
The object used to unregister the callback.
See Also

registerCallback

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.