Exemplo n.º 1
0
void GuiManager::initKeymap() {
	using namespace Common;

	Keymapper *mapper = _system->getEventManager()->getKeymapper();

	// Do not try to recreate same keymap over again
	if (mapper->getKeymap(kGuiKeymapName) != 0)
		return;

	Action *act;
	Keymap *guiMap = new Keymap(kGuiKeymapName);

	act = new Action(guiMap, "CLOS", _("Close"));
	act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0));

	act = new Action(guiMap, "CLIK", _("Mouse click"));
	act->addLeftClickEvent();

#ifdef ENABLE_VKEYBD
	act = new Action(guiMap, "VIRT", _("Display keyboard"));
	act->addEvent(EVENT_VIRTUAL_KEYBOARD);
#endif

	act = new Action(guiMap, "REMP", _("Remap keys"));
	act->addEvent(EVENT_KEYMAPPER_REMAP);

	act = new Action(guiMap, "FULS", _("Toggle FullScreen"));
	act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT));

	mapper->addGlobalKeymap(guiMap);
}
Exemplo n.º 2
0
void GuiManager::initKeymap() {
	using namespace Common;

	bool tmp;
	Keymapper *mapper = _system->getEventManager()->getKeymapper();

	// Do not try to recreate same keymap over again
	if (mapper->getKeymap("gui", tmp) != 0)
		return;

	Action *act;
	Keymap *guiMap = new Keymap("gui");

	act = new Action(guiMap, "CLOS", "Close", kGenericActionType, kStartKeyType);
	act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0));

	act = new Action(guiMap, "CLIK", "Mouse click");
	act->addLeftClickEvent();

	act = new Action(guiMap, "VIRT", "Display keyboard", kVirtualKeyboardActionType);
	act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0));

	act = new Action(guiMap, "REMP", "Remap keys", kKeyRemapActionType);
	act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0));

	mapper->addGlobalKeymap(guiMap);
}