Class: TKeyEvent

Declaration: KeyboardInput.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TKeyEvent derives from TEvent and contains the keyboard event generated by the user. The keyboard handlers receive these events on keyboard input.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TKeyEvent is the base class to all keyboard event classes such as key down, key up, modifier key down, and modifier key up. All of the deriving classes override the Dispatch member function to provide their own behavior.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TKeyEvent::TKeyEvent

  1. TKeyEvent (TKeyboardInputDevice * keyboardDevice, TStandardEventReceiver * receiver, TVirtualKeyCode :: EVirtualKey key, TModifierKeys modifierKeys)
  2. TKeyEvent (const TKeyEvent & copy)

Interface Category:

API.

Purpose:

  1. Constructs the key event given the keyboard device, event receiver, key code, and modifier.
  2. Copy constructor.

Calling Context:

  1. Called from the TKeyboardInputDevice object to distribute it to event handlers.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TKeyEvent::~TKeyEvent

virtual ~ TKeyEvent ()

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TKeyEvent::operator=

TKeyEvent & operator =(const TKeyEvent & assign)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

Returns const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TKeyEvent::GetKeyboardInputDevice

const TKeyboardInputDevice * GetKeyboardInputDevice () const

Interface Category:

API.

Purpose:

Gets the keyboard device that generated this event.

Calling Context:

Can be called by input handlers to obtain the keyboard device for this event.

Parameters:

Return Value:

Returns a const pointer to a TKeyboardInputDevice object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TKeyEvent::GetModifierKeys

virtual TModifierKeys GetModifierKeys () const

Interface Category:

API.

Purpose:

Gets the modifier keys that were held down at the time that this key event was generated.

Calling Context:

Can be called by input handlers to obtain the modifier keys that are held down.

Parameters:

Return Value:

Returns a TModifierKeys object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TKeyEvent::GetVirtualKey

virtual TVirtualKeyCode::EVirtualKey GetVirtualKey () const

Interface Category:

API.

Purpose:

Gets the virtual key that is associated with the actual key that was held down.

Calling Context:

Can be called by input handlers to obtain the virtual key for the actual key held down.

Parameters:

Return Value:

Returns a TVirtualKeyCode::EVirtualKey enumerator tag that identifies the virtual key.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not 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.