Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
None.
Purpose:
TKeyboardInputDevice derives from TInputDevice and receives events from the actual keyboard input devices. It distributes those same events to the objects that have expressed interest in them.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Normally you would not derive from this class. Rather, you would create a new TKeyboardInputDevice & TKeyboardDevice combination which will share the event message format.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
- TKeyboardInputDevice ()
- TKeyboardInputDevice (const TKeyboardInputDevice & copy)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual ~ TKeyboardInputDevice ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
TKeyboardInputDevice & operator =(const TKeyboardInputDevice & assign)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Call this function by using the operator in an assignment statement.
Parameters:
Return Value:
Returns const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream & writeTo) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & writeTo -The stream to which the object streams itself out.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream & readFrom)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & readFrom -The stream from which the object streams itself in.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws a TInvalidVersionError if the version of the object on the stream is unknown to the version of the shared library installed.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void SendEventFromMessage (TRandomAccessStream & message, TStandardEventReceiver & receiver, const TEventSynchronizer& sync)
Interface Category:
API.
Purpose:
Distributes appropriate events based on the kind of event received.
Calling Context:
Typically called from classes deriving from TStandardEventReceiver.
Parameters:
- TRandomAccessStream & message -The event message.
- TStandardEventReceiver & receiver -The receiver that will transmit the events to handlers.
- const TEventSynchronizer& sync -The event synchronizer that controls the message sending synchronization for the caller, allowing the caller to block for just the amount of time it takes to send the message.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TKeyboardInputDevice::UpdateInternalStateFromMessage
virtual void UpdateInternalStateFromMessage (TRandomAccessStream & message)
Interface Category:
API.
Purpose:
Updates the keyboard internal state (key down and modifier selected) from the keyboard event.
Calling Context:
Called from the event server implementation.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TKeyboardInputDevice::CreateInternalStateDelta
virtual void CreateInternalStateDelta (TRandomAccessStream & putDeltaHere) const
Interface Category:
API.
Purpose:
Puts the internal state (key down and modifier selected) of this input device in the event stream.
Calling Context:
Called from the event server implementation.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TKeyboardInputDevice::UpdateInternalStateFromDelta
virtual void UpdateInternalStateFromDelta (TRandomAccessStream & delta)
Interface Category:
API.
Purpose:
Updates the internal state of keyboard input device from the specified event stream.
Calling Context:
Called from the input system framework when events are sent from the driver represented by the TKeyboardInputDevice object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TKeyboardInputDevice::GetDefaultKeyboardInputDevice
- static const TKeyboardInputDevice * GetDefaultKeyboardInputDevice(const TEvent & forEvent)
- static const TKeyboardInputDevice * GetDefaultKeyboardInputDevice (const TStandardEventReceiver & fromReceiver)
Interface Category:
API.
Purpose:
- Gets the keyboard device that generated the specified event.
- Gets the keyboard device that is sending an event to the specified receiver.
Calling Context:
- Called by keyboard event handlers to access the keyboard.
- Called by keyboard event handlers to access the keyboard.
Parameters:
- const TEvent & forEvent -The event that was generated by keyboard.
- const TStandardEventReceiver & fromReceiver -The receiver for the events from the keyboard.
Return Value:
Returns a const pointer to a TKeyboardInputDevice object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
bool IsKeyDown () const
Interface Category:
API.
Purpose:
Determines if a key is down on this keyboard input device.
Calling Context:
Called by event handlers to see if a key was down.
Parameters:
Return Value:
Returns true if a key is down; false otherwise.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
TModifierKeys GetModifierKeys () const
Interface Category:
API.
Purpose:
Gets the modifier keys that are currently held down.
Calling Context:
Called by event handlers to see if a key was down.
Parameters:
Return Value:
Returns an object of type TModifierKeys.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.