Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::util::InputMap Class Reference

List of all members.

Detailed Description

maps KeyStroke s to Command s

This class may be used to modify input mappings according to the look and feel or other changes. Mouse buttons are mapped to Key s by LEFT_MOUSE_KEY MIDDLE_MOUSE_KEY and RIGHT_MOUSE_KEY.

Author:
Daniel Seibert


Public Member Functions

void add (const Key &k, const Mod &m, const Command &c)
 adds a mapping from k with modifiers m to c.
void add (const KeyStroke &k, const Command &c)
 calls InputMap::add(Key&,Mod&,Command&)
void clear ()
 clears this map
Command getCommand (const KeyStroke &k) const
 looks up the mapping for k
 InputMap (int num,...)
 creates a map with initial mappings
 InputMap ()
 creates an empty map
void remove (const Command &)
 removes all mappings to the given command
void remove (const KeyStroke &k)
 removes a mapping

Static Public Member Functions

static Mapping createMapping (const Key &, const Mod &, const Command &)
 creates a mapping from the given key/modifier combo to the given command.

Classes

struct  Mapping


Constructor & Destructor Documentation

ONE::util::InputMap::InputMap  ) 
 

creates an empty map

ONE::util::InputMap::InputMap int  num,
  ...
 

creates a map with initial mappings

This ctor expects num mappings, which have to be of type InputMap::Mapping. Such objects may be created via the InputMap::createMapping function.


Member Function Documentation

void ONE::util::InputMap::add const Key k,
const Mod m,
const Command c
 

adds a mapping from k with modifiers m to c.

If such a mapping already exists, it is modified accordingly.

Parameters:
k the key
m the modifiers
c the Command to be executed when the key stroke is received

void ONE::util::InputMap::add const KeyStroke k,
const Command c
 

calls InputMap::add(Key&,Mod&,Command&)

void ONE::util::InputMap::clear  ) 
 

clears this map

static Mapping ONE::util::InputMap::createMapping const Key ,
const Mod ,
const Command
[static]
 

creates a mapping from the given key/modifier combo to the given command.

This function may be used for inline creation of input maps via the InputMap(int,...) ctor.

Command ONE::util::InputMap::getCommand const KeyStroke k  )  const
 

looks up the mapping for k

Returns:
the registered command or UNDEFINED_COMMAND if no mapping is available for k

void ONE::util::InputMap::remove const Command  ) 
 

removes all mappings to the given command

void ONE::util::InputMap::remove const KeyStroke k  ) 
 

removes a mapping


Generated on Wed Sep 7 19:03:31 2005 for ONEngine by  doxygen 1.4.3