Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
joncampbell123 committed Sep 5, 2018
2 parents fc4729d + d6078e8 commit 29992d02a520d7358bc749ff15840dfe94127ae5
Showing with 75 additions and 33 deletions.
  1. BIN vs2015/freetype/objs/freetype.lib
  2. +75 −33 vs2015/sdl/src/video/windib/SDL_dibevents.c
BIN +2.25 MB (320%) vs2015/freetype/objs/freetype.lib
Binary file not shown.
@@ -227,10 +227,6 @@ LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
wParam = rotateKey(wParam, this->hidden->gapiInfo->coordinateTransform);
}
#endif
/* Ignore repeated keys */
if ( lParam&REPEATED_KEYMASK ) {
return(0);
}
switch (wParam) {
case VK_CONTROL:
if ( lParam&EXTENDED_KEYMASK )
@@ -243,21 +239,27 @@ LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
{
Uint8 *state = SDL_GetKeyState(NULL);
if (state[SDLK_LSHIFT] == SDL_RELEASED && (GetKeyState(VK_LSHIFT) & 0x8000)) {
wParam = VK_LSHIFT;
} else if (state[SDLK_RSHIFT] == SDL_RELEASED && (GetKeyState(VK_RSHIFT) & 0x8000)) {
wParam = VK_RSHIFT;
} else {
posted = SDL_PrivateKeyboard(SDL_PRESSED,
TranslateKey(wParam = VK_LSHIFT, HIWORD(lParam), &keysym, 0));
}
if (state[SDLK_RSHIFT] == SDL_RELEASED && (GetKeyState(VK_RSHIFT) & 0x8000)) {
posted = SDL_PrivateKeyboard(SDL_PRESSED,
TranslateKey(wParam = VK_RSHIFT, HIWORD(lParam), &keysym, 0));
}
if (wParam == VK_SHIFT) {
/* Win9x */
int sc = HIWORD(lParam) & 0xFF;
if (sc == 0x2A)
wParam = VK_LSHIFT;
else
if (sc == 0x36)
else if (sc == 0x36)
wParam = VK_RSHIFT;
else
wParam = VK_LSHIFT;
}
else {
return(0);
}
}
break;
case VK_MENU:
@@ -266,6 +268,12 @@ LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
else
wParam = VK_LMENU;
break;
default:
/* Ignore repeated keys */
if (lParam&REPEATED_KEYMASK) {
return(0);
}
break;
}
#ifdef NO_GETKEYBOARDSTATE
/* this is the workaround for the missing ToAscii() and ToUnicode() in CE (not necessary at KEYUP!) */
@@ -317,29 +325,35 @@ LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
else
wParam = VK_LCONTROL;
break;
case VK_SHIFT:
/* EXTENDED trick doesn't work here */
{
Uint8 *state = SDL_GetKeyState(NULL);
if (state[SDLK_LSHIFT] == SDL_PRESSED && !(GetKeyState(VK_LSHIFT) & 0x8000)) {
wParam = VK_LSHIFT;
} else if (state[SDLK_RSHIFT] == SDL_PRESSED && !(GetKeyState(VK_RSHIFT) & 0x8000)) {
wParam = VK_RSHIFT;
} else {
/* Win9x */
int sc = HIWORD(lParam) & 0xFF;
if (sc == 0x2A)
wParam = VK_LSHIFT;
else
if (sc == 0x36)
wParam = VK_RSHIFT;
else
wParam = VK_LSHIFT;
}
}
break;
case VK_MENU:
case VK_SHIFT:
/* EXTENDED trick doesn't work here */
{
Uint8 *state = SDL_GetKeyState(NULL);
if (state[SDLK_LSHIFT] == SDL_PRESSED && !(GetKeyState(VK_LSHIFT) & 0x8000)) {
posted = SDL_PrivateKeyboard(SDL_RELEASED,
TranslateKey(wParam = VK_LSHIFT, HIWORD(lParam), &keysym, 0));
}
if (state[SDLK_RSHIFT] == SDL_PRESSED && !(GetKeyState(VK_RSHIFT) & 0x8000)) {
posted = SDL_PrivateKeyboard(SDL_RELEASED,
TranslateKey(wParam = VK_RSHIFT, HIWORD(lParam), &keysym, 0));
}
if (wParam == VK_SHIFT) {
/* Win9x */
int sc = HIWORD(lParam) & 0xFF;
if (sc == 0x2A)
wParam = VK_LSHIFT;
else if (sc == 0x36)
wParam = VK_RSHIFT;
else
wParam = VK_LSHIFT;
}
else {
return(0);
}
}
break;
case VK_MENU:
if ( lParam&EXTENDED_KEYMASK )
wParam = VK_RMENU;
else
@@ -473,6 +487,34 @@ void DIB_PumpEvents(_THIS)
}
}
/* *sigh* It seems the Windows keyboard events allow us to sort of
differentiate left/right shift, but only as individual keys,
and Windows 10 won't send a WM_KEYUP if you release one shift
key while holding the other. Therefore, this hack:
If both shift keys are held down, poll the keyboard state to
detect when either one is released. */
Uint8 *state = SDL_GetKeyState(NULL);
if (state[SDLK_LSHIFT] == SDL_PRESSED && state[SDLK_RSHIFT] == SDL_PRESSED) {
if (state[SDLK_LSHIFT] == SDL_PRESSED) {
SDL_keysym keysym;
if (!(GetKeyState(VK_LSHIFT) & 0x8000)) {
SDL_PrivateKeyboard(SDL_RELEASED,
TranslateKey(VK_LSHIFT, HIWORD(0), &keysym, 0));
}
}
if (state[SDLK_RSHIFT] == SDL_PRESSED) {
SDL_keysym keysym;
if (!(GetKeyState(VK_RSHIFT) & 0x8000)) {
SDL_PrivateKeyboard(SDL_RELEASED,
TranslateKey(VK_RSHIFT, HIWORD(0), &keysym, 0));
}
}
}
if (!mouseMotion && now > (last_dib_mouse_motion + pollInterval))
mouseMotion = 1;

0 comments on commit 29992d0

Please sign in to comment.