InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VirtualKey Class Reference

#include <VirtualKey.h>

Public Types

typedef base_type data_type
 

Public Member Functions

 VirtualKey ()
 
 VirtualKey (SysChar character)
 
 VirtualKey (uint32 keyCode)
 
 VirtualKey (const VirtualKey &other)
 
void ReadWrite (IPMStream *s)
 
VirtualKeyoperator= (const VirtualKey &copy)
 
bool16 operator< (const VirtualKey &other) const
 
bool16 operator== (const VirtualKey &s) const
 
bool16 operator!= (const VirtualKey &s) const
 
SysChar GetChar () const
 
bool16 IsPlainChar () const
 
bool16 IsPressed () const
 
uint32 GetDVKeyCode () const
 

Detailed Description

This class encapsulates a platform independant way to handle 'virtual keys'. This allows us to do smart matching of keys that generate a plain character, as well as the tricker keys which generate extended characters or no characters. This is mostly used in our keyboard shortcut handling code. Usually code that needs a virtual key either gets it passed in, or they get one by calling IEvent::

Member Typedef Documentation

This type is a base type. It has no special copy semantics.

See Also
K2Vector.h

Constructor & Destructor Documentation

VirtualKey::VirtualKey ()
inline

Various constructors. Just record the passed in keycode and character code.

Member Function Documentation

SysChar VirtualKey::GetChar () const
inline

Get the character for this object. Return value is 0 if IsPlainChar is false.

Returns
the raw character
uint32 VirtualKey::GetDVKeyCode () const
inline

Get the drover key code for this object

Returns
the raw drover key code
bool16 VirtualKey::IsPlainChar () const

Check if this virtual key represents a plain printable character.

Returns
kTrue if this is a plain character.
bool16 VirtualKey::IsPressed () const

Check if this virtual key is pressed down

Returns
kTrue if this key is down.
bool16 VirtualKey::operator!= (const VirtualKeys) const
inline

Inequality operator. Does intelligent matching on both mac and windows

Parameters
sthe object to compare to.
Returns
kTrue if this object is not logically equal to the object passed in
bool16 VirtualKey::operator< (const VirtualKeyother) const
inline

Less than operator. Implemented so that sorting of this object will work.

Parameters
otherthe object to compare to.
Returns
kTrue if this object is logically less than the object passed in
VirtualKey& VirtualKey::operator= (const VirtualKeycopy)
inline

Assignment

Parameters
copythe object to copy into this one.
bool16 VirtualKey::operator== (const VirtualKeys) const

Equality operator. Does intelligent matching on both mac and windows

Parameters
sthe object to compare to.
Returns
kTrue if this object is logically equal to the object passed in
void VirtualKey::ReadWrite (IPMStreams)

Read or write this object from/to a stream

Parameters
sthe stream to read/write from/to