class PKeyCode: public PObject

A class representing a key from the keyboard.

Inheritance:


Public Classes

[more]enum Value
All possible keyboard values (codes representing each key on a "normalised" keyboard)
[more]enum Modifiers
All the possible modifiers to the key values specified above.

Public Methods

[more] PKeyCode ( Value theValue = NullValue, int theMods = NoModifier )
Create a new key code representation.
[more]virtual PObject* Clone () const
Create a copy of the key code.
[more]virtual Comparison Compare ( const PObject & obj ) const
Determine the relative rank of the key codes.
[more]Value GetValue () const
Get the value part of the key code.
[more]int GetModifiers () const
Get the modifiers part of the key code.
[more]BOOL IsModifier ( int modmask ) const
Determine if any of the the specified modifier(s) are set.

Public

[more] Overrides from class PObject


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

A class representing a key from the keyboard. This virtualises the key into a platform independent form that removes as far as possible the variations in keyboards and layouts.

Note that not all key values and modifiers may be generated by all target platforms.

oenum Value
All possible keyboard values (codes representing each key on a "normalised" keyboard)

oenum Modifiers
All the possible modifiers to the key values specified above. The modifiers Accelerator1 and Accelerator2 are normalised menu bar accelerators for the different platforms, e.g. for the Macintosh Accelerator1 if the Command key, which does not exist on the IBM-PC so it has Accelerator1 set to Control. An application can thus use Accelerator1 for its menu accelerator code and get the "correct" code for the platform used.

o NoModifier
No modifers present.

o Shift
Either shift key.

o Control
The control key.

o Alt
The Alt or Extend key.

o Command
The quadraphogly key on the Macintosh.

o Option
The option key on the Macintosh.

o CapsLock
The CAPS LOCK key.

o Accelerator1
The primary accelerator key.

o Accelerator2
The secondary accelerator key.

o LeftMouseButton
The left mouse button.

o RightMouseButton
The right mouse button.

o MiddleMouseButton
The middle mouse button.

o PKeyCode( Value theValue = NullValue, int theMods = NoModifier )
Create a new key code representation.
Parameters:
theValue - Value of key code.
theMods - Modifiers present for key code.

o Overrides from class PObject

ovirtual PObject* Clone() const
Create a copy of the key code.

ovirtual Comparison Compare( const PObject & obj ) const
Determine the relative rank of the key codes.

Returns:
EqualTo if the key value and modifiers are the same, LessThan if the key codes are the same but the modifier is different and GreaterThan if they are both different.
Parameters:
obj - Other key code to compare against.

oValue GetValue() const
Get the value part of the key code.

Returns:
value of key code.

oint GetModifiers() const
Get the modifiers part of the key code.

Returns:
modifiers of key code.

oBOOL IsModifier( int modmask ) const
Determine if any of the the specified modifier(s) are set. This would usually be used with a single modifier, but is not limited to it.

Returns:
TRUE if any of the modifiers in the modmask are set.
Parameters:
modmask - Mask of modifiers to check for.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.