3 Key Mapping

The TCEF_Key_Mapper class is used to manage key-to-action mappings for the host system. For instance, on a Microsoft Windows system the F1 key could be mapped to some functionality. Key names are case-insensitive, but the mapping string is stored and returned as-is. In summary, the class manages a list of key name strings, a list of valid mapping strings, and a set of strings that contain the current mapping for a given key.


This class consists of the following methods:


void Add_Key( PChar Name )


Adds a key name to the object.



void Add_Mapping( PChar Name )


Adds a valid mapping that the user can choose.



void Clear_Keys( boolean Mapping_Only )


Deletes all key names, and associated mapping text. If Mapping_Only is true, the keys are left but current mapping text is cleared.



void Clear_Mappings()


Deletes all valid mappings.



boolean Query()


Queries the user for key remapping. Returns True if the user Okayed his changes and false otherwise.



PChar Mapping( PChar Name )


Returns the text associated with the given key name. If the key is not defined, the function returns NULL.



void Set_Mapping( PChar Key, PChar Mapping )


Associates a mapping to a key. If the specified key is not defined, this does nothing.



void Terminate()


Destructs the object.