Skip to content

Commit

Permalink
Merge pull request #19 from yupferris/master
Browse files Browse the repository at this point in the history
Added support for cmd keys for OS X
  • Loading branch information
Gargaj committed May 28, 2016
2 parents 95f3df8 + 3d1ca77 commit f1b65d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions platform_sdl/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f1b65d1

Please sign in to comment.