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); }
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); }
void OSystem_Android::setupKeymapper() { #ifdef ENABLE_KEYMAPPER using namespace Common; Keymapper *mapper = getEventManager()->getKeymapper(); HardwareKeySet *keySet = new HardwareKeySet(); keySet->addHardwareKey( new HardwareKey("n", KeyState(KEYCODE_n), "n (vk)", kTriggerLeftKeyType, kVirtualKeyboardActionType)); mapper->registerHardwareKeySet(keySet); Keymap *globalMap = new Keymap("global"); Action *act; act = new Action(globalMap, "VIRT", "Display keyboard", kVirtualKeyboardActionType); act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); mapper->addGlobalKeymap(globalMap); mapper->pushKeymap("global"); #endif }
static void setupKeymapper(OSystem &system) { #ifdef ENABLE_KEYMAPPER using namespace Common; Keymapper *mapper = system.getEventManager()->getKeymapper(); Keymap *globalMap = new Keymap(kGlobalKeymapName); Action *act; HardwareKeySet *keySet; keySet = system.getHardwareKeySet(); // Query backend for hardware keys and register them mapper->registerHardwareKeySet(keySet); // Now create the global keymap act = new Action(globalMap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType); act->addEvent(EVENT_MAINMENU); act = new Action(globalMap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); act = new Action(globalMap, "PAUS", _("Pause"), kGenericActionType, kStartKeyType); act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0)); act = new Action(globalMap, "SKLI", _("Skip line"), kGenericActionType, kActionKeyType); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); act = new Action(globalMap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); act = new Action(globalMap, "REMP", _("Remap keys"), kKeyRemapActionType); act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); act = new Action(globalMap, "FULS", _("Toggle FullScreen"), kKeyRemapActionType); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); mapper->addGlobalKeymap(globalMap); mapper->pushKeymap(kGlobalKeymapName, true); #endif }
void OSystem_Android::setupKeymapper() { #ifdef ENABLE_KEYMAPPER using namespace Common; Keymapper *mapper = getEventManager()->getKeymapper(); HardwareInputSet *inputSet = new HardwareInputSet(); keySet->addHardwareInput( new HardwareInput("n", KeyState(KEYCODE_n), "n (vk)")); mapper->registerHardwareInputSet(inputSet); Keymap *globalMap = new Keymap(kGlobalKeymapName); Action *act; act = new Action(globalMap, "VIRT", "Display keyboard"); act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, KBD_CTRL)); mapper->addGlobalKeymap(globalMap); mapper->pushKeymap(kGlobalKeymapName); #endif }
static void setupKeymapper(OSystem &system) { #ifdef ENABLE_KEYMAPPER using namespace Common; Keymapper *mapper = system.getEventManager()->getKeymapper(); HardwareInputSet *inputSet = system.getHardwareInputSet(); // Query backend for hardware keys and register them mapper->registerHardwareInputSet(inputSet); // Now create the global keymap Keymap *primaryGlobalKeymap = new Keymap(kGlobalKeymapName); Action *act; act = new Action(primaryGlobalKeymap, "MENU", _("Menu")); act->addEvent(EVENT_MAINMENU); act = new Action(primaryGlobalKeymap, "SKCT", _("Skip")); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); act = new Action(primaryGlobalKeymap, "PAUS", _("Pause")); act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0)); act = new Action(primaryGlobalKeymap, "SKLI", _("Skip line")); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); #ifdef ENABLE_VKEYBD act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard")); act->addEvent(EVENT_VIRTUAL_KEYBOARD); #endif act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys")); act->addEvent(EVENT_KEYMAPPER_REMAP); act = new Action(primaryGlobalKeymap, "FULS", _("Toggle fullscreen")); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); mapper->addGlobalKeymap(primaryGlobalKeymap); mapper->pushKeymap(kGlobalKeymapName, true); // Get the platform-specific global keymap (if it exists) Keymap *platformGlobalKeymap = system.getGlobalKeymap(); if (platformGlobalKeymap) { String platformGlobalKeymapName = platformGlobalKeymap->getName(); mapper->addGlobalKeymap(platformGlobalKeymap); mapper->pushKeymap(platformGlobalKeymapName, true); } #endif }