A hardware deviceÕs communication link to the Input system. It serves to define the lifetime of a device to the Input system. By definition, there is a one-to-one correspondence between the number of TEventSender objects in existence in the entire system and the number of input devices active on that system. Thus, when a program instantiates a TEventSender, the program becomes an input device. When that TEventSender is deleted, the program ceases to be an input device.
TEventSender is used by any program that sends events. Because the communication linkage is very generic, the primary clients of TEventSender are other frameworks that define input device types, such as a keyboard framework or mouse framework. These frameworks will likely provide higher-level semantics on event sending than that provided by TEventSender. For example, a mouse framework can define protocol for sending a mouse-down event, allowing the client to specify the point at which the click occurred. The framework would package that into a stream of data which it would ask its TEventSender implementation to send.
TEventSenders can be identified across tasks by TEventSenderSurrogates. TEventSenderSurrogates are lightweight objects whose sole purpose to is identify event senders across tasks.
TEventSender has protocol for (1) registering and deregistering input devices with the Input system; and (2) sending a message to a deviceÕs TInputDevice object in a target application.
TEventSender is a concrete class, and it is not intended to be derived. As such, it is designed so that clients can delegate to an instance of TEventSender rather than inheriting from it. This stems from the basic concept of TEventSender as a communication link; TEventSender generally doesn't know what information is being passed through it, just that information is flowing through it. This allows the device writer to determine the content of a message it passes from objects in a driver task to an TInputDevice object in an application task. Similarly, TEventSender is not streamable because its defined function has no persistent state.
Creates a new event sender that adopts the specified input device. This constructor registers the new event sender with the Input system.
Creates a new event sender that adopts a copy of the specified input device. This constructor registers the new event sender with the Input system.
Calling Context:
Call this function directly.
Call this function directly.
Parameters:
TInputDevice * adoptInputDevice -The input device to be adopted.
const TInputDevice & copyInputDevice -The input device whose copy is to be adopted.
Return Value:
None.
Exceptions:
These constructors can indirectly cause an assertion during registration. An assertion is caused if the input device is NIL, or if the input device is already registered; in either case, registration does not take place.