Show Contents / Index / Search

Handling Events

Events are an integral part of the API, and provide an asynchronous way to handle state changes in Reflection 2011. By implementing event handler methods, you can receive notifications for all event-generating activity, such as keyboard input and host actions. In many cases, you can modify or cancel the activity that caused the event.

For example, BeforeSendKeys is an event that notifies you after a series of keys is entered — either programmatically or by a user — but before it is sent to a host. To prevent specific keys from being sent to a host, you can set the Cancel property to "true" in the event argument or modify the key values in the event argument.

The following code sample illustrates this concept:

BeforeSendKeys Example