| | |
| | | /* Ignore the button click for activation */ |
| | | if (!bwParamMousePressed) { |
| | | data->focus_click_pending &= ~SDL_BUTTON(button); |
| | | if (!data->focus_click_pending) { |
| | | WIN_UpdateClipCursor(data->window); |
| | | } |
| | | WIN_UpdateClipCursor(data->window); |
| | | } |
| | | if (WIN_ShouldIgnoreFocusClick()) { |
| | | return; |
| | |
| | | } |
| | | break; |
| | | |
| | | case WM_NCACTIVATE: |
| | | { |
| | | /* Don't immediately clip the cursor in case we're clicking minimize/maximize buttons */ |
| | | data->skip_update_clipcursor = SDL_TRUE; |
| | | } |
| | | break; |
| | | |
| | | case WM_ACTIVATE: |
| | | { |
| | | POINT cursorPos; |
| | | BOOL minimized; |
| | | |
| | | /* Don't mark the window as shown if it's activated before being shown */ |
| | | if (!IsWindowVisible(hwnd)) { |
| | | break; |
| | | } |
| | | |
| | | minimized = HIWORD(wParam); |
| | | if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) { |
| | |
| | | SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) != 0); |
| | | SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) != 0); |
| | | } else { |
| | | RECT rect; |
| | | |
| | | data->in_window_deactivation = SDL_TRUE; |
| | | |
| | | if (SDL_GetKeyboardFocus() == data->window) { |
| | |
| | | WIN_ResetDeadKeys(); |
| | | } |
| | | |
| | | ClipCursor(NULL); |
| | | if (GetClipCursor(&rect) && SDL_memcmp(&rect, &data->cursor_clipped_rect, sizeof(rect) == 0)) { |
| | | ClipCursor(NULL); |
| | | SDL_zero(data->cursor_clipped_rect); |
| | | } |
| | | |
| | | data->in_window_deactivation = SDL_FALSE; |
| | | } |
| | |
| | | break; |
| | | |
| | | case WM_UNICHAR: |
| | | if ( wParam == UNICODE_NOCHAR ) { |
| | | if (wParam == UNICODE_NOCHAR) { |
| | | returnCode = 1; |
| | | break; |
| | | } |
| | |
| | | case WM_CHAR: |
| | | { |
| | | char text[5]; |
| | | if ( WIN_ConvertUTF32toUTF8( (UINT32)wParam, text ) ) { |
| | | SDL_SendKeyboardText( text ); |
| | | if (WIN_ConvertUTF32toUTF8((UINT32)wParam, text)) { |
| | | SDL_SendKeyboardText(text); |
| | | } |
| | | } |
| | | returnCode = 0; |
| | |
| | | } |
| | | } |
| | | |
| | | static void WIN_UpdateClipCursorForWindows() |
| | | { |
| | | SDL_VideoDevice *_this = SDL_GetVideoDevice(); |
| | | SDL_Window *window; |
| | | |
| | | if (_this) { |
| | | for (window = _this->windows; window; window = window->next) { |
| | | if (window->driverdata) { |
| | | WIN_UpdateClipCursor(window); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* A message hook called before TranslateMessage() */ |
| | | static SDL_WindowsMessageHook g_WindowsMessageHook = NULL; |
| | | static void *g_WindowsMessageHookData = NULL; |
| | |
| | | if ((keystate[SDL_SCANCODE_RSHIFT] == SDL_PRESSED) && !(GetKeyState(VK_RSHIFT) & 0x8000)) { |
| | | SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RSHIFT); |
| | | } |
| | | |
| | | /* Update the clipping rect in case someone else has stolen it */ |
| | | WIN_UpdateClipCursorForWindows(); |
| | | } |
| | | |
| | | /* to work around #3931, a bug introduced in Win10 Fall Creators Update (build nr. 16299) |
| | |
| | | SDL_zero(info); |
| | | info.dwOSVersionInfoSize = sizeof(info); |
| | | if (getVersionPtr(&info) == 0) { /* STATUS_SUCCESS == 0 */ |
| | | if ( (info.dwMajorVersion == 10 && info.dwMinorVersion == 0 && info.dwBuildNumber >= 16299) |
| | | || (info.dwMajorVersion == 10 && info.dwMinorVersion > 0) |
| | | || (info.dwMajorVersion > 10) ) |
| | | if ((info.dwMajorVersion == 10 && info.dwMinorVersion == 0 && info.dwBuildNumber >= 16299) || |
| | | (info.dwMajorVersion == 10 && info.dwMinorVersion > 0) || |
| | | (info.dwMajorVersion > 10)) |
| | | { |
| | | return SDL_TRUE; |
| | | } |