src/video/windows/SDL_windowsevents.c


Log

Author Commit Date CI Message
Cameron Gutman a78bce9e 2021-01-28T20:02:01 Properly handle keys already down when the hook is installed For keys that are already down when we install the keyboard hook, we need to allow the WM_KEYUP/WM_SYSKEYUP message to be processed normally. This ensures that other applications see the key up, which prevents the key from being stuck down from the perspective of other apps when our grab is released.
Cameron Gutman 2793c9cf 2021-01-25T18:40:26 Fix grabbing Alt+Tab and Alt+Esc on Windows 7
Brandon DeRosier 141f4416 2021-01-24T03:55:04 fix build failure due to -Werror=declaration-after-statement (bug #5500)
Cameron Gutman 8c921d82 2021-01-22T19:40:26 Implement keyboard grab support for Windows This is implemented via a low-level keyboard hook. Unfortunately, this is rather invasive, but it's how Microsoft recommends that it be done [0]. We want to do as little as possible in the hook, so we only intercept a few crucial modifier keys there, while leaving other keys to the normal event processing flow. We will only install this hook if SDL_HINT_GRAB_KEYBOARD=1, which is not the default. This will reduce any compatibility concerns to just the SDL applications that explicitly ask for this behavior. We also remove the hook when the grab is terminated to ensure that we're not unnecessarily staying involved in key event processing when it's not required anymore. [0]: https://docs.microsoft.com/en-us/windows/win32/dxtecharts/disabling-shortcut-keys-in-games
Ozkan Sezer 01a2f276 2021-01-04T01:23:50 consistently use TEXT() macro with LoadLibrary() and GetModuleHandle() cf. bug #5435.
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga cb361896 2020-12-09T07:16:22 Fixed bug 5235 - All internal sources should include SDL_assert.h Ryan C. Gordon We should really stick this in SDL_internal.h or something so it's always available.
Sam Lantinga b9cbea35 2020-10-13T21:08:20 video: Refresh Windows display list on WM_DISPLAYCHANGE - Displays may have been added, removed or changed and all cached monitor handles are invalidated as a result. - Display events are handled in three steps: 1. Mark all currently know displays as invalid 2. Enumerate all displays, adding new ones and marking known displays as valid 3. Remove all displays still invalid after enumeration - Display connect/disconnect events are sent when displays are added or removed after initial setup
Cameron Gutman 771732ed 2020-08-27T17:54:52 windows: Fix numpad arrow key scancodes with numlock off We should only perform the VK_LEFT, VK_UP, etc. mapping if none of the other special mappings apply. This allows the scancode normalization for the number pad to take place as intended.
Cameron Gutman 72379ba5 2020-08-25T21:22:00 windows: Fix handling of swapped mouse buttons GetAsyncKeyState() and GetRawInputData() report the state of the physical buttons without applying the user's primary/secondary mouse button swap preference. Swap the buttons returned from these functions, so we expose a consistent view of the buttons to SDL callers. This new behavior also matches the behavior of macOS and X11 backends. See the Remarks section of the GetAsyncKeyState() function on MSDN.
Sam Lantinga 44f50c64 2020-06-09T21:47:41 Fixed bug 5171 - PollEvent impacts performance in 2.0.12 On some systems, GetClipCursor() impacts performance when called frequently, so only call it every once in a while to make sure we haven't lost our capture.
Sam Lantinga 488b94cb 2020-04-07T09:18:19 Don't interpret raw input messages with no mouse position This happens occasionally on touch devices when raw input is enabled
Sam Lantinga 0721931f 2020-04-06T19:21:56 Avoid sending regular mouse messages for touch input
Sam Lantinga 6fe6946a 2020-02-11T21:19:05 Fixed relative mode mouse events stopping if you click on the title bar
Sam Lantinga f867cebb 2020-02-11T08:36:13 Fixed bug 4709 - incorrect (not) handling of windows on-screen cursor keys Alex Denisov When using Win10 on-screen keyboard (tooltip.exe), the left and right cursor keys in it do not produce SDLK_LEFT and SDLK_RIGHT events. Windows messages generated by the on-screen keyboard, for some reason, have their scancodes set to zeroes. Here is the log from Spy++: WM_KEYDOWN nVirtKey:VK_LEFT cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0 WM_KEYUP nVirtKey:VK_LEFT cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1 Regular physical keyboard produces VK_LEFT (ScanCode:4B) and VK_RIGHT (ScanCode:4D) which are interpreted correctly. With on-screen keyboard, the switch statement in VKeytoScancode() does not check for VK_LEFT and VK_RIGHT, returning SDL_SCANCODE_UNKNOWN, which in turn does not get mapped to anything (because the scan codes are zeroes).
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sylvain Becker 758badff 2019-10-23T08:58:52 Fixed bug 4841 - Misplaced parenthesis WIN_WindowProc / WM_ACTIVATE / ClipCursor (Thanks!)
Ozkan Sezer 8a394209 2019-09-05T20:47:20 SDL_windowsevents.c: remove isVistaOrNewer (not used since 8cb1dc50bb28)
Sam Lantinga cc64b369 2019-08-30T15:32:15 Allow mouse messages from Wacom pens, e.g. right click pen buttons, etc.
Sam Lantinga afb9ff95 2019-08-30T08:03:19 Fixed bug where the Steam overlay would generate an event and stop input processing for the frame.
Sam Lantinga 13c4d5e7 2019-08-26T17:43:01 Fixed Windows relative mouse coordinates when capturing the mouse over RDP
Alex Szpakowski d5ec735a 2019-08-01T18:22:12 Add a windowID field to SDL_TouchFingerEvent (bug #4331). This is unimplemented on some platforms and will cause compile errors when building those platform backends for now.
Ozkan Sezer c37c6cbb 2019-07-31T23:37:02 use WIN_IsWindowsVistaOrGreater() from core/windows for isVistaOrNewer
Sam Lantinga e7c2cf10 2019-07-15T09:36:53 Fixed bug 4704 - SDL_HINT_ANDROID_SEPERATE_MOUSE_AND_TOUCH on Windows? superfury I notice that, somehow, when locking the mouse into place(using SDL_SetRelativeMouseMode), somehow at least the movement information gets through to both mouse movement and touch movement events? My app handles both, so when moving a touched finger accross the app(using RDP from an Android device) I see the mouse moving inside the app when it shouldn't(meaning that the touch movement is ignored properly by the app(press-location dependant) but the mouse movement is still performed due to the mouse movement events)?
Cameron Gutman 7e09718d 2019-07-07T11:23:16 Ignore synthetic mouse events generated for touchscreens Windows generates fake raw mouse events for touchscreens for compatibility with legacy apps that predate touch support in Windows. We already handle touch events explicitly, so drop the synthetic events to avoid duplicates.
Ryan C. Gordon 399df540 2019-06-11T01:14:24 windows: Drop WM_ACTIVATE when window is hidden, but only if being activated. Fixes Bugzilla #4571.
Sam Lantinga f2c8d8e9 2019-06-08T10:47:43 Fixed bug 4443 - Incorrect scan code reported for numpad 5 bplu4t2f When num lock is on, the scancode reported for numpad 5 is SDL_SCANCODE_KP_5, which is correct. However, when num lock is off, windows reports the VK_CLEAR virtual key code, which is incorrectly translated into SDL_SCANCODE_CLEAR inside of the VKeytoScancode(WPARAM vkey) function.
Sylvain Becker b45abbb2 2019-04-02T17:57:27 Bug 4576: fix warning and compile
Sylvain Becker 1a4c3b57 2019-04-02T16:58:11 Bug 4576: remove touch/mouse duplication for Windows
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Alex Szpakowski 5029d50e 2018-11-10T16:15:48 Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id). Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates). Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
Ryan C. Gordon 4659e738 2018-11-01T12:31:45 merge fallout: Patched to compile, fixed some compiler warnings, etc.
Ryan C. Gordon 62494a2e 2018-10-31T15:03:41 Merge SDL-ryan-batching-renderer branch to default.
Ryan C. Gordon b262b0eb 2018-10-22T20:50:32 Small stack allocations fall back to malloc if they're unexpectedly large.
Sam Lantinga 55b24b93 2018-09-26T11:17:43 Fixed bug 4265 - SDL window falls to the bottom of the screen when dragged down and stuck there Alexei On WM_WINDOWPOSCHANGED event, WIN_UpdateClipCursor() is called. SDL_WINDOW_INPUT_FOCUS is set even when the mouse pointer is not inside the SDL window and therefore ClipCursor(&rect) is called. When dragging the window and rect.bottom=800 (i.e. the bottom edge of the screen) the SDL window is clipped to the bottom of the screen and it is not possible to move it back to the center of the screen.
Sam Lantinga a1ca8441 2018-08-26T20:37:23 Update the cursor clipping each frame, in case it was stolen by another application.
Sam Lantinga 15b3794f 2018-08-26T10:34:23 Only reset the clip rect if it's currently the rect we previously clipped. This prevents us from clearing the clip rect globally when another application has set it. There's also an experimental change to regularly update the clip rect for a window defensively, in case someone else has reset it. It works well, but I don't know if it's cheap enough to call as frequently as it would be called now, and might have other undesirable side effects. Also fixed whitespace and SDL coding style
Sam Lantinga a4d0571e 2018-05-07T20:10:12 Reverted change for bug 4152 - restrict the win10 mouse bug workaround to win10 v1709 only Daniel Gibson Sorry, but it seems like Microsoft didn't fix the issue properly. I just updated my Win10 machine, it now is Version 1803, Build 17134.1 I tested with SDL2 2.0.7 (my workaround was released with 2.0.8) and still got lots of events that directly undid the prior "real" events - just like before. (See simple testcase in attachement) By default it sets SDL_HINT_MOUSE_RELATIVE_MODE_WARP - which triggered (and on my machine still triggers) the buggy behavior. You can start it with -raw, then it'll not set that hint and the events will be as expected. The easiest way to see the difference is looking at the window title, which shows accumulated X and Y values: If you just move your mouse to the right, in -raw mode the number just increases. In non-raw mode (using mouse warping) it stays around 0. I also had a WinAPI-only testcase: https://gist.github.com/DanielGibson/b5b033c67b9137f0280af9fc53352c68 It just calls SetCursorPos(320,240); on each WM_MOUSEMOVE event, and it also logs all those events to a mouseevents.log textfile. This log indeed looks a bit different since the latest Win10 update: It seems like all those events with x=320 y=240 do arrive - but only after I stopped moving the mouse - even though the cursor seems to be moved back every frame (or so). So moving the mouse to the right gives X coordinates like 330, 325, 333, 340, 330, ... and then when stopping movement I get lots of events with X coordinate 320
Sam Lantinga 606c5a58 2018-05-05T10:27:53 Fixed bug 4152 - Windows 10 v1803 update seems to have fixed the jumping mouse bug (see bug #3931.)
Sam Lantinga 4d78a995 2018-03-26T12:38:29 Fixed bug where an SDL window that was activated while hidden could never be shown. Test code: { SDL_Window *win = SDL_CreateWindow( "Dummy", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 128, 128, SDL_WINDOW_HIDDEN ); SDL_SysWMinfo info; SDL_VERSION( &info.version ); SDL_GetWindowWMInfo( win, &info ); SetActiveWindow( info.info.win.window ); { DWORD then = SDL_GetTicks(); while ( ( SDL_GetTicks() - then ) < 3000 ) { SDL_Event evt; SDL_PollEvent( &evt ); } SDL_ShowWindow( win ); then = SDL_GetTicks(); while ( ( SDL_GetTicks() - then ) < 3000 ) { SDL_Event evt; SDL_PollEvent( &evt ); } } SDL_DestroyWindow( win ); }
Sam Lantinga 5abd7d16 2018-02-13T22:58:20 Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window transition
sezero 40b27fd5 2018-02-12T17:00:00 revert the recent typecast assignment changes (see bug #4079) also change the void* typedefs for the two vulkan function pointers added in vulkan_internal.h into generic function pointer typedefs.
Sam Lantinga 7b50aee9 2018-02-08T18:07:14 Fixed min/max window size handling for borderless resizable windows
Sam Lantinga 90e72bf4 2018-01-30T18:08:34 Fixed ISO C99 compatibility SDL now builds with gcc 7.2 with the following command line options: -Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Sam Lantinga 1b16618b 2017-12-11T11:47:52 Fixed Windows gcc build
Sam Lantinga ab06f570 2017-12-10T09:17:33 Workaround for bug 3931 - spurious SDL_MOUSEMOTION events with SDL_HINT_MOUSE_RELATIVE_MODE_WARP 1 since Windows 10 Fall Creators update Elis?e Maurer The attached minimal program sets the SDL_HINT_MOUSE_RELATIVE_MODE_WARP to 1, enables relative mouse mode then logs all SDL_MOUSEMOTION xrel values as they happen. When moving the mouse exclusively to the right: * On a Windows 10 installation before Fall Creators update (for instance, Version 10.0.15063 Build 15063), only positive values are reported, as expected * On a Windows 10 installation after Fall Creators update (for instance, Version 10.0.16299 Update 16299), a mix of positive and negative values are reported. 3 different people have reproduced this bug and have confirmed it started to happen after the Fall Creators update was installed. It happens with SDL 2.0.7 as well as latest default branch as of today. It seems like some obscure (maybe unintended) Windows behavior change? Haven't been able to pin it down more yet. (To force-upgrade a Windows installation to the Fall Creators update, you can use the update assistant at https://www.microsoft.com/en-us/software-download/windows10) Eric Wasylishen Broken GetCursorPos / SetCursorPos based games on Win 10 fall creators are not limited to SDL.. I just tested winquake.exe (original 1997 exe) and it now has "jumps" in the mouse input if you try to look around in a circle. It uses GetCursorPos/SetCursorPos by default. Switching WinQuake to use directinput (-dinput flag) seems to get rid of the jumps. Daniel Gibson A friend tested on Win10 1607 (which is before the Fall Creators Update) and the the bug doesn't occur there, so the regression that SetCursorPos() doesn't reliably generate mouse events was indeed introduced with that update. I even reproduced it in a minimal WinAPI-only application (https://gist.github.com/DanielGibson/b5b033c67b9137f0280af9fc53352c68), the weird thing is that if you don't do anything each "frame" (i.e. the mainloop only polls the events and does nothing else), there are a lot of mouse events with the coordinates you passed to SetCursorPos(), but when sleeping for 10ms in each iteration of the mainloop, those events basically don't happen anymore. Which is bad, because in games the each iteration of the mainloop usually takes 16ms.. I have a patch now that I find acceptable. It checks for the windows version with RtlGetVersion() (https://msdn.microsoft.com/en-us/library/windows/hardware/ff561910.aspx) and only if it's >= Win10 build 16299, enables the workaround. All code is in video/windows/SDL_windowsevents.c and the workaround is, that for each WM_MOUSEMOVE event, "if(isWin10FCUorNewer && mouseID != SDL_TOUCH_MOUSEID && mouse->relative_mode_warp)", an addition mouse move event is generated with the coordinates of the center of the screen (SDL_SendMouseMotion(data->window, mouseID, 0, center_x, center_y);) - which is exactly what would happen if windows generated those reliably itself. This will cause SDL_PrivateSendMouseMotion() to set mouse->last_x = center_x; and mouse->last_y = center_y; so the next mouse relative mouse event will be calculated correctly. If Microsoft ever fixes this bug, the IsWin10FCUorNewer() function would have to be adjusted to also check for a maximum version, so the workaround is then disabled again.
Sam Lantinga 25df5a5a 2017-11-28T18:31:18 Non-resizable windows need to have their window rect set to the client rect
Sam Lantinga 54685787 2017-09-26T15:07:35 Fixed bug 3847 - Hit Test x coordinate wrong on secondary monitor Robert Turner SDL_windowsevents.c contains code to retrieve the x and y coordinate for a requested hit test. It does this as follows: POINT winpoint = { (int) LOWORD(lParam), (int) HIWORD(lParam) }; LOWORD(lParam) does not correctly mask off high bits that are set if the point is on a second (or third, etc.) monitor. This effectively offsets the x-coordinate by a large value. MSDN documentation suggests that LOWORD() and HIWORD() are the wrong macros for the task, instead suggesting we should be doing something like the following: POINT winpoint = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; Testing this change on my Windows 10 machine with 2 monitors gives the correct results.
Sam Lantinga 3176a7f5 2017-09-22T07:11:36 sdl - Fixing rendering borderless window. Need to force windows to send a WM_NCCALCSIZE then return 0 for non-client area size. - Adding WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX to borderless windows, for reasons noted in comments. - Fix SetupWindowData() setting SDL_WINDOW_BORDERLESS. This was being cleared at window creation, causing hanlding for the first WM_NCCALCSIZE message to fail
Sam Lantinga a4cfa936 2017-08-14T21:28:04 Fixed bug 2293 - Precise scrolling events Martijn Courteaux I implemented precise scrolling events. I have been through all the folders in /src/video/[platform] to implement where possible. This works on OS X, but I can't speak for others. Build farm will figure that out, I guess. I think this patch should introduce precise scrolling on OS X, Wayland, Mir, Windows, Android, Nacl, Windows RT. The way I provide precise scrolling events is by adding two float fields to the SDL_MouseWheelScrollEvent datastructure, called "preciseX" and "preciseY". The old integer fields "x" and "y" are still present. The idea is that every platform specific code normalises the scroll amounts and forwards them to the SDL_SendMouseWheel function. It is this function that will now accumulate these (using a static variable, as I have seen how it was implemented in the Windows specific code) and once we hit a unit size, set the traditional integer "x" and "y" fields. I believe this is pretty solid way of doing it, although I'm not the expert here. There is also a fix in the patch for a typo recently introduced, that might need to be taken away by the time anybody merges this in. There is also a file in Nacl which I have stripped a horrible amount of trailing whitespaces. (Leave that part out if you want).
Sam Lantinga c87e1d52 2017-08-13T14:15:52 Fixed bug 2841 - Hint to set resource id for window icon Alexey Seems to be a missing functionality. I want to set an icon from RC file. I cant pass MAKEINTRESOURCE(X) string to SDL_RegisterApp() cause string returned by MAKEINTRESOURCE string is not actually a string and SDL_strlen will crash. Moreover LoadImage seems to be loading wrong icon size. LoadIcon seems to be fine.
Sam Lantinga 47c2c7d5 2017-08-12T12:56:28 Cleaned up WindowsScanCodeToSDLScanCode() so VKeytoScancode() always takes precedence for the keys it handles and the rest of the logic is easier to read.
Sam Lantinga 843293be 2017-08-09T20:26:16 Fixed bug 3701 - WM_TOUCH message may cause calls to null if touch functions are not properly loaded Simon Hug When WIN_WindowProc processes the WM_TOUCH message, it doesn't check if the touch functions have been properly loaded and may call a NULL pointer. It's probably an extremely rare case, but here's a patch that adds some checks anyway.
ouned 34769abd 2017-06-03T09:13:08 prefer virtual keycodes over scancodes for extended keys
Sam Lantinga 77240762 2017-05-16T17:48:57 Fixed restoring a window that was maximized then minimized, then restored.
Philipp Wiesemann 444c47a1 2017-04-29T22:50:35 windows: Changed six internal functions to be static.
Sam Lantinga 52e9c42d 2017-01-28T14:35:35 Fixed Windows build
Sam Lantinga 869b7fe3 2017-01-28T11:17:10 Fixed bug 3550 - No mouse move messages send while over the titlebar and windows edges Matthew Its possible to set SDL_CaptureMouse() so you continue receiving mouse input while the mouse is outside your window. This works however There is then a gap where no messages send, which is when the mouse is hovering the title bar and the window edges.
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Sam Lantinga d5ddb3cb 2016-10-14T08:40:21 Fixed bug 3453 - First mouse button input after a drag and drop event is ignored Olav Sorensen After a drag and drop event, any following mouse button input (down/up) doesn't generate an event. Clicking any mouse button a *second* time generates an event like it should. Further investigation shows that the new SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH logic also causes this issue in other cases, like the first time you open the program and click the mouse.
Sam Lantinga 27d4f099 2016-10-07T23:40:44 Implemented SDL_GetHintBoolean() to make it easier to check boolean hints
Sam Lantinga f4b26cd8 2016-10-01T13:16:31 Removed carriage returns from previous patch
Sam Lantinga 7b0ccd32 2016-10-01T13:14:51 Fixed bug 3405 - Wrong default icon size on windows systems Evgeny Vrublevsky Original code in the video/windows/SDL_windowsevents.c registers obsolete WNDCLASS (not WNDCLASSEX). As the result only one icon size is used as the small and normal icons. Also original code doesn't specify required size of an icon. As the result when 256x256 icon is available, the program uses it as a default icon, and it looks ugly. We have to use WNDCLASSEX and load icons with proper sizes which we can get using GetSystemMetrics. Better idea. We could use the first icon from resources, like the Explorer does. Patch is included. It also correctly loads large and small icons, so it will look nice everywhere.
Sam Lantinga 0b576962 2016-10-01T12:17:42 Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications.
Ryan C. Gordon e64c5186 2016-09-29T23:42:18 windows: Removed hardcoded "1" for mouse clickthrough hint.
Ryan C. Gordon f2fcd324 2016-09-29T23:12:58 windows: fix borderless windows at desktop resolution (thanks, Evgeny!). Fixes Bugzilla #3404.
Sam Lantinga d285af2a 2016-09-29T14:48:33 Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH
Sam Lantinga 8ddb4328 2016-09-29T03:59:04 When clicking on a window to give it focus, don't pass the mouse click to the application.
Ethan Lee c3e48e71 2016-04-12T10:45:56 Force WM_PAINT events on window resize
Ryan C. Gordon 8e855f2f 2016-01-05T01:42:00 Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops. This allows an app to know when a set of drops are coming in a grouping of some sort (for example, a user selected multiple files and dropped them all on the window with a single drag), and when that set is complete. This also adds a window ID to the drop events, so the app can determine to which window a given drop was delivered. For application-level drops (for example, you launched an app by dropping a file on its icon), the window ID will be zero.
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
David Ludwig 854cf7ac 2015-12-30T12:44:13 Fixed Bug 3215 - Win32: 'fullscreen' app doesn't always extend to top of screen
Ryan C. Gordon fd6b435c 2015-12-28T13:08:19 Windows: resync num/caps lock when window is gaining focus.
Sam Lantinga 2b0140a9 2015-10-27T11:17:32 Add a new SDL_KEYMAPCHANGED SDL event to abstract notification of keyboard layout or input language changes.
Sam Lantinga 5b174113 2015-10-06T21:40:50 Converted tabs to spaces for SDL style
Sam Lantinga 9bd640e1 2015-10-06T21:16:21 Fixed sending a size event while setting up a window (fix for DOTA 2 on Source 2)
andrewb a702c338 2015-08-03T11:37:03 Add SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 to SDL so that Reborn can keep running through Alt+F4.
Sam Lantinga e93f90ae 2015-07-30T10:01:04 Trivial integer truncation warning fixes.
Sam Lantinga 3a08b463 2015-06-25T11:49:48 Fixed bug 2834 - Patch to support dead keys on Windows Elise Maurer When inputting text, dead-keys are currently not handled correctly on Windows with the latest SDL2 tip as well as the 2.0.3 release. Using a French AZERTY keyboard, when I type the `^` key followed by `e` key to compose the `` character, I erroneously get two SDL_TEXTINPUT events, one with the `^` character and one with the `e` character. I've looked at the history for SDL_windowsevents.c and there's been some back-and-forth with several methods for handling text input: * r8142 removed any handling of WM_CHAR because keyboard input was being handled through WM_KEYDOWN along with ToUnicode since r7645. * But using ToUnicode actually breaks dead-keys (googling for "ToUnicode dead keys" reports many horror stories of people trying to work around that and failing). * It seems like r7645 introduced a double-fix: it fixed WM_CHAR to properly handle Unicode, and also (unnecessarily?) added text input handling to WM_KEYDOWN. Later, r8142 removed the WM_CHAR stuff instead of the WM_KEYDOWN stuff. The attached patch restores handling of text input through WM_CHAR and removes it from WM_KEYDOWN. I've tested it with French, English and Russian layouts and it seems to do its job. Obviously, with such matters, it's still a risky change.
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().
Sam Lantinga 6e67c949 2015-05-28T12:55:01 Fixed bug 2054 - SDL_GetError: "Unknown touch device" Volumetric The "Unknown touch device" message appears because the initial touch device setup loop uses SDL_GetTouch() as a guard for calling SDL_AddTouch(). SDL_GetTouch() will always report "Unknown touch device" since the device hasn't been added yet. The SDL_GetTouch() call is unnecessary since SDL_AddTouch() calls SDL_GetTouchIndex() to verify that the device hasn't been added yet, and SDL_GetTouchIndex() has the benefit of not reporting an error for a device it can't find.
Ryan C. Gordon 41908548 2015-05-26T20:40:00 Windows: Alt-F4 hotkey should be checked on keydown, not keyup (thanks, Matt!). Fixes Bugzilla #2780.
Ryan C. Gordon b11b3493 2015-05-26T11:08:30 Windows: don't beep on Alt-* key combos (Thanks, historic_bruno!). Fixes Bugzilla 2669.
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Sam Lantinga 1c6ea0f2 2015-05-13T22:39:32 Added a userdata parameter to SDL_SetWindowsMessageHook()
Sam Lantinga 7de242e7 2015-05-13T22:39:20 Added SDL_SetWindowsMessageHook() to facilitate full IME support on Windows
Ryan C. Gordon aa4952fd 2015-04-21T10:10:59 Added SDL_WINDOWEVENT_HIT_TEST. This lets windows know when they are dropping a mouse event because their hit test reported something other than SDL_HITTEST_NORMAL. It lets them know exactly where in the event queue this happened. This patch is based on work in Unreal Engine 4's fork of SDL, compliments of Epic Games.
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Philipp Wiesemann 060d243f 2015-03-06T21:34:10 Windows: Fixed ignoring return value of internal function. If the function WIN_ConvertUTF32toUTF8() failed (should currently not be possible) a not terminated string would have been sent as text input event. This also fixed converting characters more often than needed on key repetition.
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
David Ludwig a6df21cd 2014-12-20T11:45:39 Partial fix for bug 2726 - Win32 'mouse' events not applying 'SDL_TOUCH_MOUSEID' This is a Win32-specific fix for bug 2726. A WinRT fix for this bug was applied separately, via https://hg.libsdl.org/SDL/rev/91f56dcad879 This fix applies SDL_TOUCH_MOUSEID to 'mouse' events coming from touch devices, but only when relative-mouse-mode is turned OFF. This bug is still present when relative-mouse-mode is ON, however Microsoft does not provide documentation on whether or not those input events (which come from WM_INPUT) can be identified as touch-specific or not. Unofficially, that data might be available (via GetMessageExtraInfo()), however this patch only uses MS-documented APIs.
David Ludwig 70438be2 2014-12-03T10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
Edward Rudd 5b5823ee 2014-11-23T21:09:54 add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.
Pierre-Loup A. Griffais 24c86b55 2014-09-11T19:24:42 [X11] Reconcile logical keyboard state with physical state on FocusIn since the window system doesn't do it for us like other platforms. This prevents sticky keys and missed keys when going in and out of focus, for example Alt would appear to stick if switching away from an SDL app with Alt-Tab and had to be pressed again. CR: Sam
Sam Lantinga 1ee96bb9 2014-07-07T10:26:28 Fixed mingw64 build and warnings
Ryan C. Gordon b29740b8 2014-06-25T17:06:12 Merged Ryan's SDL-gui-backend branch. Adds three APIs, and implements them on X11, Cocoa, and Windows: - SDL_CaptureMouse() - SDL_GetGlobalMouseState() - SDL_SetWindowHitTest()