andEvent Creates an event that occurs only when the two given events happen simultaneously. keyDown Retrieves a DXMEvent when a specific key is pressed. keyUp Retrieves a DXMEvent when a specific key is released. notEvent Creates an event that occurs when the given event does not occur. orEvent Creates an event that occurs when either one of the given events occurs. predicate Creates an event that occurs when the value of the given Boolean behavior changes from false to true. thenEvent Creates an event if e2 occurs after e1. timer Creates an event that occurs when the specified time has elapsed. unregisterCallback Used to unregister the callback.
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.
Syntax
public static DXMEvent andEvent( DXMEvent first, DXMEvent second );
Parameters
- first and second
- DXMEvent objects.
Return Value
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.
Retrieves a DXMEvent when a specific key is pressed. This is a state-transition event.
Syntax
public static DXMEvent keyDown( int keyCode );
Parameters
- keyCode
- Can either be quoted characters such as 'a' or specific Java keycode constants.
Return Value
Returns the DXMEvent object. This event produces no data.
Remarks
The following table lists the hexadecimal values for all the special keycodes. The pattern for each key is 0x10000 plus the Win32 scan code.
Key | KeyCode |
---|---|
PGUP | 10021 |
PGDN | 10022 |
END | 10023 |
HOME | 10024 |
LEFT | 10025 |
UP | 10026 |
RIGHT | 10027 |
DOWN | 10028 |
INSERT | 1002D |
DELETE | 1002E |
NUMPAD0 | 10060 |
NUMPAD1 | 10061 |
NUMPAD2 | 10062 |
NUMPAD3 | 10063 |
NUMPAD4 | 10064 |
NUMPAD5 | 10065 |
NUMPAD6 | 10066 |
NUMPAD7 | 10067 |
NUMPAD8 | 10068 |
NUMPAD9 | 10069 |
MULTIPLY | 1006A |
ADD | 1006B |
SEPARATOR | 1006C |
SUBTRACT | 1006D |
DECIMAL | 1006E |
DIVIDE | 1006F |
F1 | 10070 |
F2 | 10071 |
F3 | 10072 |
F4 | 10073 |
F5 | 10074 |
F6 | 10075 |
F7 | 10076 |
F8 | 10077 |
F9 | 10078 |
F10 | 10079 |
F11 | 1007A |
F12 | 1007B |
F13 | 1007C |
F14 | 1007D |
F15 | 1007E |
F16 | 1007F |
F17 | 10080 |
F18 | 10081 |
F19 | 10082 |
F20 | 10083 |
F21 | 10084 |
F22 | 10085 |
F23 | 10086 |
F24 | 10087 |
Retrieves a DXMEvent when a specific key is released. This is a state-transition event.
Syntax
public static DXMEvent keyUp( int keyCode );
Parameters
- keyCode
- Can either be quoted characters such as 'a' or specific Java keycode constants.
Return Value
Returns the DXMEvent object. This event produces no data.
Remarks
For a list of special keycodes, see keyDown.
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.
Syntax
public static DXMEvent notEvent( DXMEvent ev );
Parameters
- ev
- DXMEvent object.
Return Value
Returns the DXMEvent object. This event produces no data.
Creates an event that occurs when either one of the given events occurs. The event time for the new event is when either the first or second given event has occurred.
Syntax
public static DXMEvent orEvent( DXMEvent first, DXMEvent second );
Parameters
- first and second
- DXMEvent objects.
Return Value
Returns a DXMEvent object. Its data is the event data of either the first or second event.
Creates an event that occurs when the value of the given Boolean behavior changes from false to true.
Syntax
public static DXMEvent predicate( BooleanBvr bool );
Parameters
- bool
- BooleanBvr object.
Return Value
Returns the DXMEvent. This event produces no data.
Remarks
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 whensin(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.
Creates an event if e2 occurs after e1. The event time of the new event is the time of the second event.
Syntax
public static DXMEvent thenEvent( DXMEvent e1, DXMEvent e2 );
Parameters
- e1
- First event, that, when it occurs, triggers the second event.
- e2
- Second event, caused by the occurrence of the first event.
Return Value
Returns the DXMEvent object. Its event data is the time the second event fired and a PairObject containing the event data for both events.
Creates an event that occurs when the specified time has elapsed.
Syntax
public static DXMEvent timer( NumberBvr timeout );
Parameters
- timeout
- NumberBvr object. This parameter can also be of type double.
Return Value
Returns the DXMEvent object. This event produces no data.
Used to unregister the callback.
Syntax
public static void unregisterCallback( Object object );
Parameters
- object
- Object used to unregister the callback.
See Also
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.