inline const Modifier *getButton(unsigned int button) const { ButtonSet::const_iterator iter = buttonState.find(button); if (iter != buttonState.end()) { return &((*iter).second.mod); } else { return NULL; } }
inline bool getButton(unsigned int button, Modifier mod) const { ButtonSet::const_iterator iter = buttonState.find(button); if (iter != buttonState.end()) { return (*iter).second.mod == mod; } else { return false; } }
void Buttons::invoke(int key, int state, int mods, float force) { ButtonSet* btns = getButtons(key); for (ButtonSet::iterator i = btns->begin(); i != btns->end(); ++i) (*i)->func(state,mods,force); }