src/events


Log

Author Commit Date CI Message
Sam Lantinga 3f93f56b 2023-08-02T01:08:00 Fixed duplicate key press/release events on iOS When a hardware keyboard is attached, it can take over 100 ms for the keyboard event to generate text input. In that case we want to record that we recently received a keyboard event so we don't synthesize duplicate virtual key press/release events for the input text. (cherry picked from commit 648de4f9b8ebcf9e794aba2ec2955d129167c48b) (cherry picked from commit 38c63afd64450cab8166485c7f93f2cf6c0fa038)
Sam Lantinga 3f1fd5ab 2023-05-23T10:59:03 Updated source to match SDL function prototype style
Sam Lantinga a2f4783e 2023-05-22T11:30:42 Don't map the top keyboard row to numbers when using the one-handed DVORAK layouts (thanks @tormol!) Fixes https://github.com/libsdl-org/SDL/pull/5127
Sam Lantinga 00b87f1d 2023-05-20T10:27:48 Make sure the sentinel is at the end of the current event pump cycle If we're waiting, it's possible to not get any events, then add the sentinel, then pump again and then add another sentinel. We want to make sure we only have one sentinel and that it's at the end of the currently pumped events. Testing: * Verified test case in https://github.com/libsdl-org/SDL/issues/6539 * Verified test case in https://github.com/libsdl-org/SDL/issues/5350 Fixes https://github.com/libsdl-org/SDL/issues/6539
Frank Praznik c0824cd4 2023-03-26T12:53:50 events: Increase the size of the name buffer when logging events Event names have grown in length and are occasionally truncated when being logged (e.g. SDL_EVENT_WINDOW_PIXEL_SIZE_CHA). Increase the event name buffer size to handle the longer names. (cherry picked from commit 203a2a76fc0af2094de84d75dbf959c7db73fe72)
Sylvain 45e5f0f1 2023-02-13T09:40:44 Fixed bug #7302 - Memory 'leak' in SDL_SetMouseSystemScale()
Sylvain 17515f4a 2023-02-04T15:51:37 Backport simplify flags PR #7220
Sean Ridenour af5efadd 2023-02-04T10:29:59 Setting the same mouse cursor twice is a no-op This fixes extremely poor event polling performance on MacOS when using Dear ImGui, which sets the mouse cursor every frame.
Sam Lantinga 0479df53 2023-01-09T09:48:21 Updated copyright for 2023
Sam Lantinga 74229d4a 2022-12-29T14:52:28 Fixed keyboard scancode mapping for parenthesis (thanks to @meyraud705 for tracking down the root cause!) Fixes https://github.com/libsdl-org/SDL/issues/6787 Closes https://github.com/libsdl-org/SDL/pull/6937 (cherry picked from commit e1bd5bd071d066e7009261f96c896423f6fd8fd0)
Sam Lantinga d59caffe 2022-12-13T14:03:40 Added support for clang thread-safety analysis The annotations have been added to SDL_mutex.h and have been made public so applications can enable this for their own code. Clang assumes that locking and unlocking can't fail, but SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change. This commit cleans up a bunch of rare race conditions in the joystick and game controller code so now everything should be completely protected by the joystick lock. To test this, change the compiler to "clang -Wthread-safety -Werror=thread-safety -DSDL_THREAD_SAFETY_ANALYSIS"
Sam Lantinga be3b1cff 2022-12-08T17:03:29 Added logging for SDL_DISPLAYEVENT_MOVED
Pierre Wendling d0bbfdbf 2022-12-01T16:07:03 Clang-Tidy fixes (#6725) (cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
Sam Lantinga b8d85c69 2022-11-30T12:51:59 Update for SDL3 coding style (#6717) I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594 (cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
Sylvain Becker fb0ce375 2022-11-27T17:38:43 Cleanup add brace (#6545) * Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line (cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)
Sam James 4c7156c1 2022-11-24T05:21:21 Avoid use of deprecated egrep/fgrep GNU grep 3.8 emits a deprecation warning on use of egrep/fgrep. Signed-off-by: Sam James <sam@gentoo.org> (cherry picked from commit 3e7952ce8a0affd325c802755cae5fd843b86d99)
Sam Lantinga ea4ea27a 2022-11-18T11:14:14 Don't trigger an error if we try to delete a touch device after shutting down the touch system This can happen on Raspberry Pi if the display system fails to initialize.
Sylvain ddad901c 2022-11-17T10:43:45 Remove unneeded semicolon
Frank Praznik 8ea96f36 2022-11-16T11:32:31 events: Remove X and XKB keysym constants and headers The XKB_KEY_* and XK_* macros resolve to the same constant values, so use the raw values and note what keys they correspond to in the comments, as is done for the other keysym values in this file. This completely eliminates the need for any X or XKB system headers along with the if/else defines.
ulatekh ec58a817 2022-10-05T19:26:09 Fixes made in response to running a static code analyzer under MS Windows. Most of these are probably harmless, but the changes to SDL_immdevice.c and SDL_pixels.c appear to have fixed genuine bugs. SDL_audiocvt.c: By separating the calculation of the divisor, I got rid of the suspicion that dividing a double by an integer led to loss of precision. SDL_immdevice.c: Added a missing test, one that could have otherwise led to dereferencing a null pointer. SDL_events.c, SDL_gamecontroller.c, SDL_joystick.c, SDL_malloc.c, SDL_video.c: Made it clear the return values weren't used. SDL_hidapi_shield.c: The size is zero, so nothing bad would have happened, but the SDL_memset() was still being given an address outside of the array's range. SDL_dinputjoystick.c: Initialize local data, just in case IDirectInputDevice8_GetProperty() isn't guaranteed to write to it. SDL_render_sw.c: drawstate.viewport could be null (as seen on line 691). SDL.c: SDL_MostSignificantBitIndex32() could return -1, though I don't know if you want to cope with that (what I did) or SDL_assert() that it can't happen. SDL_hints.c: Replaced boolean tests on pointer values with comparisons to NULL. SDL_pixels.c: Looks like the switch is genuinely missing a break! SDL_rect_impl.h: The MacOS static checker pointed out issues with the X comparisons that were handled by assertions; I added assertions for the Y comparisons. SDL_yuv.c, SDL_windowskeyboard.c, SDL_windowswindow.c: Checked error-result returns.
Sam Lantinga 98f93d0a 2022-11-15T11:39:06 Fixed building without xkbcommon support
Sam Lantinga 615901db 2022-11-15T11:19:08 Removed unnecessary header The xkbcommon-keysyms.h header isn't available on some older systems, and we don't actually need it for this code.
Frank Praznik c8551847 2022-11-04T12:41:46 wayland: Handle virtual keyboards that don't fit the X mapping SDL is built around the concept of keyboards having a fixed layout with scancodes that correspond to physical keys no matter what linguistic layout is used. Virtual keyboards don't have this concept and can present an arbitrary layout of keys with arbitrary scancodes and names, which don't fit the SDL model. When one of these keyboards is encountered, it requires special handling: use the keysym of the pressed keys to derive their ANSI keyboard scancode equivalents for control keys and ASCII characters. All other characters are passed through as text events only.
Frank Praznik d1858eb1 2022-11-04T12:33:45 events: Add a helper function to get the default keycode for a scancode Add a helper function to get the keycode for a scancode from the default lookup table. Unlike SDL_GetKeyFromScancode(), this is not affected by the set keymap.
Frank Praznik 0e446c54 2022-11-04T12:27:36 events: Factor out the xkb keysym to scancode conversion from the X11 driver
pionere b886f4c6 2022-11-14T17:35:28 events: eliminate redundant code in SDL_SendEditingText
pionere e873d609 2022-11-07T10:02:06 fix handling of SDL_EventQ.active - SDL_EventQ.active is a bool variable -> do not use SDL_AtomicGet/Set, it does not help in any way - protect SDL_EventQ.active with SDL_EventQ.lock - set SDL_EventQ.active to FALSE by default
Ethan Lee 9c8b1fd8 2022-10-29T22:34:05 wayland: Cleanup work to aid reconnect support Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
Ryan C. Gordon b9e1d1b4 2022-10-09T19:49:34 events: Rename SDL_SendKeyboardKeyComplete to SDL_SendKeyboardKeyAndKeycode.+
Ryan C. Gordon 92215481 2022-10-09T19:33:52 emscripten: Make an attempt at correct keyboard scancode/keycodes. This uses a newer browser API to get physical scancodes, but still uses the (deprecated) event field that we were already using for scancodes, but for keycodes instead now, which appears to be more accurate. Since keyboard layout isn't (generally) available to web apps, this adds an internal interface to send key events with both scancode and keycode to SDL's internals, instead of sending just scancodes and expecting SDL to use its own keymap to generate keycodes. Future work in this area would be to use the keyboard layout APIs on browsers that support them, which would allow us to use SDL's usual keymap code and not rely on a deprecated browser API, but until we get there, this patch gives significantly more correct results than we would have before. Fixes #2098.
GNQG 965ba1e0 2022-10-18T19:03:19 fix SDL_SendEditingText when long composition text is enabled and strlen(text) == SDL_TEXTEDITINGEVENT_TEXT_SIZE
Sam Lantinga 6bb0c2a5 2022-10-14T06:33:38 Added documentation for some scancodes
Sam Lantinga 99f2a503 2022-10-13T22:40:24 X11 scancode mapping cleanup * Consolidated scancode mapping tables into a single location for all backends * Verified that the xfree86_scancode_table2 is largely identical to the Linux scancode table * Updated the Linux scancode table with the latest kernel keycodes (still unmapped) * Route X11 keysym -> scancode mapping through the linux scancode table (which a few hand-written exceptions), which will allow mappings to automatically get picked up as they are added in the Linux scancode table * Disabled verbose reporting of missing keysym mappings, we have enough data for now
Sam Lantinga b18c361b 2022-10-08T13:18:00 Updated variable name for mouse coordinates in mouse wheel events
Sam Lantinga 4f318c90 2022-10-08T12:01:42 Add cursor position to mouse wheel event (thanks @meyraud705!) Fixes https://github.com/libsdl-org/SDL/pull/6351
Sam Lantinga 92b3c53c 2022-08-22T16:25:25 Added a hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether to use system mouse acceleration on raw relative motion. This is currently only implemented on Windows, and "Enhanced pointer precision" mode is not quite correct.
Sam Lantinga 0e61c106 2022-08-22T12:49:41 Don't calculate relative mouse motion if we don't have a valid position Fixes https://github.com/libsdl-org/SDL/issues/1928
Sam Lantinga f42291ce 2022-08-11T16:13:14 Don't change mouse capture based on touch events Fixes https://github.com/libsdl-org/SDL/issues/5652
Sam Lantinga 3861c557 2022-08-11T13:58:39 Added the hint SDL_HINT_MOUSE_RELATIVE_WARP_MOTION This hint controls whether mouse warping generates motion events in relative mode, and defaults off. Fixes https://github.com/libsdl-org/SDL/issues/6034 Fixes https://github.com/libsdl-org/SDL/issues/5741
Sam Lantinga 0cd5b08b 2022-08-01T09:43:15 Fixed infinite loop when SDL_SendKeyboardText() is passed invalid UTF-8 text
Ryan C. Gordon cf63af8a 2022-07-31T22:10:45 events: Don't lose window RESIZED events during SIZED_CHANGED processing. Previously, calling SDL_SendWindowEvent for a SIZED_CHANGED event would filter the queue to remove RESIZED and SIZED_CHANGED events, so you don't overflow the queue with obsolete data, but any RESIZED events would be lost in this process. Now we note if there was a RESIZED pending and replace it with a new event using the same dimensions as the new SIZED_CHANGED event. This fixes cases where an app is only listening for RESIZED events and thus might lose important information in some cases. Fixes #5925.
Cameron Gutman 9515fb25 2022-07-31T16:10:10 keyboard: Use SDL_SetKeymap() to set the default keymap This ensures the AZERTY workaround is applied for backends that never call SDL_SetKeymap() themselves.
Cameron Gutman 8b438f7b 2022-07-31T15:34:03 keyboard: Only send SDL_KEYMAPCHANGED when the keymap actually changes
diddily 1e492b2f 2022-07-25T10:12:53 Improve behavior of SDL_events_need_periodic_poll() and SDL_events_need_polling() SDL_events_need_periodic_poll() and SDL_events_need_polling() are intended to allow the event loop to update joysticks and/or sensors if needed, however those systems only update when the SDL_update_joysticks and/or SDL_update_sensors variables are true. This change brings the behavior of these functions in line with if work will actually need to be performed. This change allows the hints for AUTO_UPDATE to influence the polling behavior of the event loop such that an app can choose to update joysticks/sensors itself and avoid the expense of constantly sleeping and waking the event loop. Additionally in makes these functions marginally faster in some situations by not searching the active events.
diddily d9bda89f 2022-07-25T10:03:36 Fix updating SDL_update_joysticks and SDL_update_sensors in response to hint changes Hint callbacks are called before the actual value in the hint is changed, so the functions SDL_AutoUpdateJoysticksChanged and SDL_AutoUpdateSensorsChanged were not actually properly updating their respective variables in repsonse to their auto update hint changing. Instead, we pull the new hint value out of the value passed into the callback and use that to update the variables. Assume true on a null value as that was the previous behavior and it matches with the default values of SDL_update_joysticks/SDL_update_sensors.
Sam Lantinga 2373da5d 2022-07-11T09:49:00 Exposed SDL_ResetKeyboard() as a public function This will be used by Source 2 titles to reset keyboard state before showing assertion dialogs
chalonverse f317d619 2022-07-01T13:59:14 Xbox GDKX support (#5869) * Xbox GDK support (14 squashed commits) * Added basic keyboard testing * Update readme * Code review fixes * Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
Sam Lantinga bdbf90e3 2022-07-01T09:17:30 on-screen keyboard newline is reported as an Enter key
Sam Lantinga 7ac5d616 2022-07-01T08:58:08 Fixed backspace being delivered after committed text on Android 12 Testing: Enter "hello ", followed by "?" - the events generated are: : commitText hello : Key pressed : scancode 11 = H, keycode 0x00000068 = H modifiers: (none) : Key released: scancode 11 = H, keycode 0x00000068 = H modifiers: (none) : Key pressed : scancode 8 = E, keycode 0x00000065 = E modifiers: (none) : Key released: scancode 8 = E, keycode 0x00000065 = E modifiers: (none) : Key pressed : scancode 15 = L, keycode 0x0000006C = L modifiers: (none) : Key released: scancode 15 = L, keycode 0x0000006C = L modifiers: (none) : Key pressed : scancode 15 = L, keycode 0x0000006C = L modifiers: (none) : Key released: scancode 15 = L, keycode 0x0000006C = L modifiers: (none) : Key pressed : scancode 18 = O, keycode 0x0000006F = O modifiers: (none) : Key released: scancode 18 = O, keycode 0x0000006F = O modifiers: (none) : Key pressed : scancode 44 = Space, keycode 0x00000020 = Space modifiers: (none) : Key released: scancode 44 = Space, keycode 0x00000020 = Space modifiers: (none) : INPUT Text (\x68\x65\x6c\x6c\x6f\x20): "hello " : finishComposingText : deleteSurroundingText 1 / 0 : Key pressed : scancode 42 = Backspace, keycode 0x00000008 = Backspace modifiers: (none) : Key released: scancode 42 = Backspace, keycode 0x00000008 = Backspace modifiers: (none) : commitText ? : Key pressed : scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift modifiers: LSHIFT : Key pressed : scancode 56 = /, keycode 0x0000002F = / modifiers: (none) : Key released: scancode 56 = /, keycode 0x0000002F = / modifiers: (none) : Key released: scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift modifiers: (none) : INPUT Text (\x3f): "?" : setComposingText , at 1 : EDIT Text (): "" Previously, the backspace would be delivered after the "?"
Cameron Cawley 78089e65 2022-07-01T13:08:31 Remove unused internal header SDL_sysevents.h
Sam Lantinga 0ad65277 2022-06-29T17:26:09 Refactored code to send scancodes for an ASCII on-screen keyboard key
chalonverse 3b191580 2022-06-27T17:19:39 Windows GDK Support (#5830) * Added GDK * Simplfied checks in SDL_config_wingdk.h * Added testgdk sample * Added GDK readme * Fixed error in merge of SDL_windows.h * Additional GDK fixes * OpenWatcom should not export _SDL_GDKGetTaskQueue * Formatting fixes * Moved initialization code into SDL_GDKRunApp
Sam Lantinga adc68758 2022-06-17T10:22:28 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!) Closes https://github.com/libsdl-org/SDL/pull/5811
Cameron Gutman 81d3addd 2022-06-11T12:59:33 events: Fix spurious early returns from SDL_WaitEvent()/SDL_WaitEventTimeout() Fixes #5780
Sam Lantinga 5669743a 2022-05-19T09:45:57 Make sure SDL_CaptureMouse() is only called on the main thread Windows handles mouse capture on a per-thread basis, and capture must be done on the thread used to create a window. Fixes https://github.com/libsdl-org/SDL/issues/5577
Pierre Wendling 501a4991 2022-05-05T18:44:32 Add clang-format on/off comments where necessary. Comments were added in places where INDENT-ON/OFF comments are. Places like stdlib's asm don't need it as clang-format doesn't try to indent it.
Sam Lantinga f9a9d3c8 2022-05-18T17:23:49 Also restore previous capture window if CaptureMouse() fails
Sam Lantinga 7044452d 2022-05-18T17:15:10 Handle recursion in SDL_UpdateMouseCapture() Fixes https://github.com/libsdl-org/SDL/pull/5608
Sam Lantinga e19a9a79 2022-05-18T15:29:59 Fixed a message box getting the mouse capture state out of sync
Sam Lantinga 06aca7ed 2022-05-18T10:09:24 Fixed warping back into the window when gaining focus with warp relative mode enabled
Sam Lantinga b44241ab 2022-05-18T08:50:59 Don't send mouse events when warping in relative mode This fixes games which set relative mode and then did mouse warping at the same time Reference https://github.com/libsdl-org/SDL/issues/5609
Cameron Cawley 2f924020 2022-05-05T20:12:07 Add SDL_SCANCODE_CALL and SDL_SCANCODE_ENDCALL
Cameron Cawley 2bc37362 2022-05-05T13:31:26 Add SDL_SCANCODE_SOFTLEFT and SDL_SCANCODE_SOFTRIGHT
Susko3 6150245d 2022-05-03T00:11:44 Add new verbosity level for logging of `SDL_SysWMEvent`s Now logged only if SDL_HINT_EVENT_LOGGING is set to "3" or above.
Sam Lantinga fa073ed0 2022-04-22T22:31:04 Revert "Fix relative mouse input for Unvanquished (unvanquished.net)" This reverts commit 331859079674465a39b24f32a6a113959601dca3. Fixes https://github.com/libsdl-org/SDL/issues/5569
Sam Lantinga 27fc582b 2022-04-05T15:11:49 Minor cleanup
Sam Lantinga 86acb1a3 2022-04-05T15:05:07 Handle interaction between auto capture and the SDL_CaptureMouse() API Fixes https://github.com/libsdl-org/SDL/issues/5457
Ivan Epifanov 96be9cdd 2022-03-27T21:48:09 Vita: add hint to select which touchpad generates mouse events
Ryan C. Gordon 4fe7b2cb 2022-03-24T11:00:43 static analysis: Fixed several complaints from codechecker. There are still some pending Objective-C specific issues. Reference issue #4600.
Ryan C. Gordon f782abe5 2022-03-22T09:52:52 hints: Added SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE. Fixes #2349.
Sam Lantinga 5ff42438 2022-03-17T17:39:46 Added a hint to capture the mouse when mouse buttons are pressed, defaulting on Fixes https://github.com/libsdl-org/SDL/issues/5301
Sam Lantinga 09b8152f 2022-03-17T17:19:21 Use SDL_Log instead of printf
Sam Lantinga ecaa22cb 2022-03-17T14:22:51 Don't warn if anyone peeps for events after quitting the event subsystem Fixes https://github.com/libsdl-org/SDL/issues/5013
Antoine Fontaine 33185907 2022-03-09T17:02:32 Fix relative mouse input for Unvanquished (unvanquished.net) Here's an IRC dump that hopefully explains the issue this fixes: > I'm debugging something odd where, for a libre game, unvanquished.net (a FPS), relative mouse input in fullscreen is buggy > it's like, working mostly ok, but it has a weird performance/cleanup bug > after some time in relative mouse input mode, some time as low as 15s, usually more, the SDL sends A LOT of relative mouse input per frame > almost all of which have xrel==0 && yrel==0 > by A LOT, I mean that after ~1min, it's usually in the thousands per frame > each frame, a while ( SDL_PollEvent( &e)) loop reads the inputs, but it seems SDL is not clearing the list. > one way to clear the list is to open the in-game console or menu, which switches the input mode to absolute, then close it which gets a working relative input mode (for some time at least) > I've shown the issue to be present with SDL2.0.20 but not with 2.0.14 on my system > some other players on Arch Linux (SDL2.0.20) report a possibly related issue, where some keys seem to be pressed at random > I've did some bisection on SDL master, and I've found that there are actually two commits involved, one breaking it totally (no input at all), and one fixing it partially (with the problem described above) First related commit that breaks it totally: commit 82793ac279d19b5bde8fc2bd62877b05ba5a76e0 Author: Sam Lantinga <slouken@libsdl.org> Date: Thu Oct 14 14:26:21 2021 -0700 Fixed mouse warping while in relative mode We should get a mouse event with an absolute position and no relative motion and shouldn't change the OS cursor position at all Second related commit, that halfway fixes it: commit 31f8c3ef4409a93fafa894b78c2ce176bd0c3cf3 Author: Sam Lantinga <slouken@libsdl.org> Date: Thu Jan 6 11:27:44 2022 -0800 Fixed event pump starvation if the application frequently pushes its own events Reverting the first commit did fix the issue for me, but would probably reintroduce the bug it was fixing(?). This patch should fix it for everyone hopefully. https://github.com/DaemonEngine/Daemon/issues/600 is the upstream bug, and contains some early investigation.
Sam Lantinga cc152103 2022-03-17T11:37:08 Fixed warnings when building with cygwin Fixes https://github.com/libsdl-org/SDL/issues/5025
Zach Reedy d14a1263 2022-03-11T17:45:17 IME Composition Truncation + SDL_IsTextInputShown + SDL_ClearComposition (#5398) * Fixes for IME Composition Truncation + Addition of SDL_ClearComposition, SDL_IsTextInputShown * Fixed: Documentation and code style issues raised during code review.
Cameron Gutman b2463a91 2022-03-06T15:02:53 events: Add logging support for several missing event types
Sam Lantinga 2e801b1a 2022-03-04T10:49:12 Split long text input into multiple events if needed (thanks @zreedy!)
Sam Lantinga 6c531c43 2022-02-21T11:35:31 Correct handling of sentinel events when polling without removing events Fixes https://github.com/libsdl-org/SDL/issues/5350
Sylvain 34d4f5b1 2022-02-08T11:32:20 Fixed bug #2032: add SDL_GetTouchName to expose the driver name of the device (Thanks @mgerhardy!)
pionere e2f70a2d 2022-01-19T12:51:26 cleanup SDL_EventState
pionere ebdd5366 2022-01-17T16:26:02 use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError
Sam Lantinga 84320266 2022-01-25T12:37:43 Fixed the queue filling up with sentinel events when the WaitEvent call is passed NULL for the event The use case is an application that waits for events on the main thread and dispatches them on a separate thread.
ulatekh 8f8b14cb 2022-01-21T17:10:09 Synthesize a missing touch-up event. If a touch-down event is received for an existing touch-ID, that probably means the operating system lost it, and that the missing touch-up should be synthesized, to keep the client state coherent.
Sam Lantinga d8129c56 2022-01-10T10:50:59 Mark internal function as static
Sam Lantinga dca281e8 2022-01-08T08:49:34 Fixed getting different results for SDL_PollEvent(NULL) and SDL_PollEvent(&event)
Sam Lantinga 289c3fbb 2022-01-07T17:07:22 Revert "We only need to add the sentinel at the top of SDL_WaitEventTimeout()" This reverts commit c477768e6f926c38d4cdc236cab8376faf9f6789. We want to add the sentinel anytime we pump inside SDL_WaitEventTimeout() to avoid pumping again the next time through, as a performance optimization.
Sam Lantinga c477768e 2022-01-06T18:58:30 We only need to add the sentinel at the top of SDL_WaitEventTimeout()
Cameron Gutman e9134b04 2022-01-06T19:38:10 events: Only add sentinels for pumping done inside SDL_WaitEventTimeout() We don't want to catch explicit SDL_PumpEvents() calls by the application with our polling check to avoid stale data. If the call to SDL_PumpEvents() produced no events, there will be a sentinel sitting in the queue that will cause SDL_PollEvent() to immediately return 0 next time it is called. Our SDL_WaitEventTimeout() implementation avoids this issue by always popping an event after calling SDL_PumpEvents(). This will remove the new sentinel if we didn't get any new events.
Sam Lantinga 95485884 2022-01-06T13:58:39 Move special sentinel handling inside SDL_PeepEvents()
Sam Lantinga 2592e621 2022-01-06T13:30:26 Clarify that timeout == 0 is handled at the top of SDL_WaitEventTimeout()
Sam Lantinga 8ff21668 2022-01-06T12:56:07 Only return from SDL_PollEvent() if the last sentinel is consumed
Sam Lantinga c9ff90b9 2022-01-06T12:03:09 Clarify comment Co-authored-by: Simon McVittie <smcv@debian.org>
Sam Lantinga 31f8c3ef 2022-01-06T11:27:44 Fixed event pump starvation if the application frequently pushes its own events
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Cameron Gutman 9ae56cb3 2021-12-06T21:18:23 events: Add logging for SDL_MOUSEWHEEL preciseX/Y fields
Sylvain 0445c13a 2021-11-22T16:49:17 Remove 'malloc' from comment
Sylvain e72beeb2 2021-11-22T16:40:29 Remove 'malloc' from comment
Cameron Gutman d7d67af4 2021-11-14T17:52:41 mouse: Fix Y value in motion events when confinement is active
Sam Lantinga dfb834d3 2021-11-10T13:41:44 Track button state for each mouse input source separately This way we'll get button down and up events for each mouseID individually. Fixes https://github.com/libsdl-org/SDL/issues/4518