From 3d1ca7782f16b42e940eca786d4fc5b2710be315 Mon Sep 17 00:00:00 2001 From: ferris Date: Sat, 28 May 2016 20:40:00 +0200 Subject: [PATCH] Added support for cmd keys for OS X --- platform_sdl/Renderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform_sdl/Renderer.cpp b/platform_sdl/Renderer.cpp index 6f4c74cb..b272d9c0 100644 --- a/platform_sdl/Renderer.cpp +++ b/platform_sdl/Renderer.cpp @@ -459,6 +459,8 @@ namespace Renderer case SDLK_RALT: case SDLK_LCTRL: case SDLK_RCTRL: + case SDLK_LGUI: + case SDLK_RGUI: sciKey = 0; break; default: @@ -468,7 +470,7 @@ namespace Renderer if ((bNormalKey && E.key.keysym.mod) || !bNormalKey) { - keyEventBuffer[keyEventBufferCount].ctrl = E.key.keysym.mod & KMOD_LCTRL || E.key.keysym.mod & KMOD_RCTRL; + keyEventBuffer[keyEventBufferCount].ctrl = E.key.keysym.mod & KMOD_LCTRL || E.key.keysym.mod & KMOD_RCTRL || E.key.keysym.mod & KMOD_LGUI || E.key.keysym.mod & KMOD_RGUI; keyEventBuffer[keyEventBufferCount].alt = E.key.keysym.mod & KMOD_LALT || E.key.keysym.mod & KMOD_RALT; keyEventBuffer[keyEventBufferCount].shift = E.key.keysym.mod & KMOD_LSHIFT || E.key.keysym.mod & KMOD_RSHIFT; keyEventBuffer[keyEventBufferCount].scanCode = sciKey; @@ -905,7 +907,7 @@ namespace Renderer glReadPixels(0, 0, nWidth, nHeight, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo[readIndex]); unsigned char * downsampleData = (unsigned char *)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); - if (downsampleData) + if (downsampleData) { memcpy( pPixelBuffer, downsampleData, sizeof(unsigned int) * nWidth * nHeight ); glUnmapBuffer(GL_PIXEL_PACK_BUFFER);