Example #1
0
void Frigid::checkBindings() {
	BindingManager *bm = BindingManager::instance();

	for (uint32 i = 0; i < bm->getBindingCount(); ++i) {
		Binding b = bm->getBinding(i);
		bool key = Input::isKeyDown(b.key);
		bool modifiers = true;
		for (int j = 0; j < b.modifiers.size(); ++j) {
			if (!Input::isKeyDown(b.modifiers[j])) {
				modifiers = false;
				break;
			}
		}

		if (key && modifiers) {
			doCommand(b.cmd);
			return;
		}
	}
}
Example #2
0
void CodeEditor::checkBindings() {
	BindingManager *bm = BindingManager::instance();
	//Make it so if other keys are pressed ignore it.
	for (uint32 i = 0; i < bm->getBindingCount(); ++i) {
		Binding b = bm->getBinding(i);
		bool key = Input::isKeyDown(b.key);
		bool modifiers = true;

		for (int j = 0; j < b.modifiers.size(); ++j) {
			if (!Input::isKeyDown(b.modifiers[j])) {
				modifiers = false;
				break;
			}
		}

		if (key && modifiers) {
			doCommand(b.cmd);
			return;
		}
	}
}