MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / handleHotkeys

Method handleHotkeys

source/modes/GameMode.cpp:1072–1089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070}
1071
1072void GameMode::handleHotkeys(OIS::KeyCode keycode)
1073{
1074 ODFrameListener& frameListener = ODFrameListener::getSingleton();
1075 InputManager& inputManager = mModeManager->getInputManager();
1076
1077 //keycode minus two because the codes are shifted by two against the actual number
1078 unsigned int keynumber = keycode - 2;
1079
1080 if (getKeyboard()->isModifierDown(OIS::Keyboard::Shift))
1081 {
1082 inputManager.mHotkeyLocationIsValid[keynumber] = true;
1083 inputManager.mHotkeyLocation[keynumber] = frameListener.getCameraViewTarget();
1084 }
1085 else if (inputManager.mHotkeyLocationIsValid[keynumber])
1086 {
1087 frameListener.cameraFlyTo(inputManager.mHotkeyLocation[keynumber]);
1088 }
1089}
1090
1091void GameMode::onFrameStarted(const Ogre::FrameEvent& evt)
1092{

Callers

nothing calls this directly

Calls 2

cameraFlyToMethod · 0.80
getCameraViewTargetMethod · 0.45

Tested by

no test coverage detected