Exemplo n.º 1
0
void RemapDialog::handleOtherEvent(Event ev) {
	if (ev.type == EVENT_GUI_REMAP_COMPLETE_ACTION) {
		// _keymapper is telling us that something changed
		_changes = true;
		stopRemapping();
	} else {
		GUI::Dialog::handleOtherEvent(ev);
	}
}
Exemplo n.º 2
0
void RemapDialog::clearMapping(uint i) {
	if (_topAction + i >= _currentActions.size())
		return;

	debug(3, "clear the mapping %u", i);
	Action *activeRemapAction = _currentActions[_topAction + i].action;
	activeRemapAction->mapInput(0);
	activeRemapAction->getParent()->saveMappings();
	_changes = true;

	// force refresh
	stopRemapping(true);
	refreshKeymap();
}
Exemplo n.º 3
0
void RemapDialog::handleKeyUp(Common::KeyState state) {
	if (_activeRemapAction) {
		const HardwareKey *hwkey = _keymapper->findHardwareKey(state);

		debug(0, "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);

		if (hwkey) {
			_activeRemapAction->mapKey(hwkey);
			_activeRemapAction->getParent()->saveMappings();
			_changes = true;
			stopRemapping();
		}
	} else {
		GUI::Dialog::handleKeyUp(state);
	}
}
Exemplo n.º 4
0
void RemapDialog::startRemapping(uint i) {
	if (_topAction + i >= _currentActions.size())
		return;

	if (_keymapper->isRemapping()) {
		// Handle a second click on the button as a stop to remapping
		stopRemapping(true);
		return;
	}

	_remapTimeout = g_system->getMillis() + kRemapTimeoutDelay;
	Action *activeRemapAction = _currentActions[_topAction + i].action;
	_keymapWidgets[i].keyButton->setLabel("...");
	_keymapWidgets[i].keyButton->draw();
	_keymapper->startRemappingMode(activeRemapAction);

}
Exemplo n.º 5
0
void RemapDialog::handleTickle() {
	if (_keymapper->isRemapping() && g_system->getMillis() > _remapTimeout)
		stopRemapping(true);
	Dialog::handleTickle();
}
Exemplo n.º 6
0
void RemapDialog::handleMouseDown(int x, int y, int button, int clickCount) {
	if (_keymapper->isRemapping())
		stopRemapping();
	else
		Dialog::handleMouseDown(x, y, button, clickCount);
}
Exemplo n.º 7
0
void RemapDialog::handleTickle() {
	if (_activeRemapAction && g_system->getMillis() > _remapTimeout)
		stopRemapping();
	Dialog::handleTickle();
}
Exemplo n.º 8
0
void RemapDialog::handleMouseDown(int x, int y, int button, int clickCount) {
	if (_activeRemapAction)
		stopRemapping();
	else
		Dialog::handleMouseDown(x, y, button, clickCount);
}