From 2a2d6a777bbf19e0a6932b7d08f4f0acdfc2e38f Mon Sep 17 00:00:00 2001 From: scottbeebiwan <38970930+scottbeebiwan@users.noreply.github.com> Date: Thu, 5 Jul 2018 18:06:27 -0700 Subject: [PATCH] Keyboard camera controls. Comma: Pan Left Period: Pan Right I: Zoom in O: Zoom out --- main.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index cf6d0cc..e78c5df 100644 --- a/main.cpp +++ b/main.cpp @@ -890,15 +890,24 @@ void Demo::onUserInput(UserInput* ui) { Sleep(10); } } - + // Camera KB Handling { + if (GetKPBool(VK_OEM_COMMA)) //Left + usableApp->cameraController.panLeft(); + else if (GetKPBool(VK_OEM_PERIOD)) // Right + usableApp->cameraController.panRight(); + else if (GetKPBool(0x49)) // Zoom In (I) + usableApp->cameraController.Zoom(1); + else if (GetKPBool(0x4F)) // Zoom Out (O) + usableApp->cameraController.Zoom(-1); + // } //readMouseGUIInput(); // Add other key handling here } - - - +bool GetKPBool(int VK) { + return (GetKeyState(VK) & 0x8000); +} void makeFlag(Vector3 &vec, RenderDevice* &rd) {