Class: TKeyboardInputDevice

Declaration: KeyboardInput.h

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.

Member Function: TKeyboardInputDevice::TKeyboardInputDevice

  1. TKeyboardInputDevice ()
  2. TKeyboardInputDevice (const TKeyboardInputDevice & copy)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TKeyboardInputDevice::~TKeyboardInputDevice

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.

Member Function: TKeyboardInputDevice::operator=

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.

Member Function: TKeyboardInputDevice::operator>>=

virtual TStream & operator >>=(TStream & writeTo) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

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.

Member Function: TKeyboardInputDevice::operator<<=

virtual TStream & operator <<= (TStream & readFrom)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

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.

Member Function: TKeyboardInputDevice::SendEventFromMessage

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:

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

  1. static const TKeyboardInputDevice * GetDefaultKeyboardInputDevice(const TEvent & forEvent)
  2. static const TKeyboardInputDevice * GetDefaultKeyboardInputDevice (const TStandardEventReceiver & fromReceiver)

Interface Category:

API.

Purpose:

  1. Gets the keyboard device that generated the specified event.
  2. Gets the keyboard device that is sending an event to the specified receiver.

Calling Context:

  1. Called by keyboard event handlers to access the keyboard.
  2. Called by keyboard event handlers to access the keyboard.

Parameters:

Return Value:

Returns a const pointer to a TKeyboardInputDevice object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TKeyboardInputDevice::IsKeyDown

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.

Member Function: TKeyboardInputDevice::GetModifierKeys

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.