src/video/emscripten/SDL_emscriptenevents.c


Log

Author Commit Date CI Message
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
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).
Ryan C. Gordon 599d9ba1 2017-06-05T21:30:25 emscripten: listen for pointerlockchange events on the #document specifically.
Philipp Wiesemann 75931972 2017-05-26T22:45:40 emscripten: Fixed compiling on C89 compilers.
Charlie Birks 126e5a1d 2017-05-24T14:04:39 Emscripten: Prevent default on arrow keys
Patrick Monaghan f839b209 2017-05-24T14:04:25 Emscripten: fixed incorrect conversion of touch motion events to mouse motion events
Philipp Wiesemann 29222db7 2017-05-13T23:00:35 emscripten: Fixed not removing pointer lock event callback.
Philipp Wiesemann cc5b4f45 2017-05-12T23:01:17 emscripten: Changed internal functions to be static.
Ryan C. Gordon 93a6191c 2017-04-20T13:00:54 emscripten: keep track of pointer lock losses and maybe regrab pointer later. If an Emscripten app is in relative mouse mode and the user presses Escape (or whatever is appropriate), then the pointer lock is broken by the browser. This keeps track of those losses, and next time the user presses a mouse button down on the canvas, if the app is still meant to be in relative mouse mode, we will attempt to regrab the pointer. This makes it much more seamless for things like first-person shooters, and the app doesn't need any manual intervention.
Charlie Birks 613955b4 2017-02-17T10:13:07 Emscripten: only update pixel ratio if HiDPI is enabled
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Philipp Wiesemann c3451262 2016-11-18T00:05:28 Emscripten: Fixed handling of deactivated mouse events. SDL_GetEventState() was called with a button state instead of an event type.
Csongor Szabo 01f62736 2016-10-14T17:06:28 emscripten: check if device pixel ratio has changed
Sam Lantinga 00791f3a 2016-09-13T00:09:21 Only prevent the default browser event handling when the specific event types aren't disabled by the user, patch contributed by Jonas Platte
Charlie Birks 993dd835 2016-09-13T00:04:00 Add mapping for media keys
Jukka Jyl?nki 7cf44f1b 2016-09-13T00:03:51 Remove unused variable warning from Emscripten build in Emscripten_HandleFullscreenChange().
Boris Gjenero b54eb82c 2016-09-13T00:03:49 Unpress all keys on blur to avoid stuck keys
Boris Gjenero a0a75f38 2016-09-13T00:03:48 Listen for blur and focus events on window instead of canvas Blur and focus events were not arriving for the canvas in Firefox 35 and Chrome 40.
Boris Gjenero 3e5c4cec 2016-09-13T00:03:46 Mouse events use CSS coordinates, so don't scale by pixel_ratio
Boris Gjenero a20c40c4 2016-09-13T00:03:45 Accumulate subpixel mouse motion so motion is not lost. Previously when the canvas was scaled up and the pointer was locked, motion corresponding to less than one pixel was lost. Therefore, slow mouse motion resulted in no motion. This fixes that.
TelpeNight 443998ff 2016-09-13T00:03:44 Fix of mouse events in browser without pointer locks
Charlie Birks 98ec8443 2016-09-13T00:03:39 send mouse move on enter/leave
Charlie Birks a2ef0db8 2016-09-13T00:03:37 listen for mouse up on document (fixes mouseup outside canvas)
Charlie Birks cd05184f 2016-09-13T00:03:36 use SDL_SetMouseFocus
Sam Lantinga bdca510f 2016-09-13T00:03:28 simplify fullscreen handling using new fullscreen_strategy api, patch contributed by Charlie Birks
Charlie Birks be08cc61 2016-09-12T23:58:08 use css size for touch normalisation
Ryan C. Gordon d05ae194 2016-08-12T19:59:00 emscripten: send fake mouse events for touches, like other targets do. (This really should be handled at the higher level and not in the individual targets, but this fixes the immediate bug.)
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
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().
Philipp Wiesemann 5d6aa08b 2015-06-09T21:06:29 Emscripten: Fixed SDL_GetTouchDevice() returning 0 for the valid device index. The single touch device gets SDL_TouchID 1 (like on iOS and WinRT).
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.
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Philipp Wiesemann a54d038b 2015-05-16T21:15:27 Emscripten: Fixed wrong source comment and updated web link.
Philipp Wiesemann 3f51758e 2015-05-06T21:10:48 Emscripten: Fixed touch coordinates not being normalized.
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 8f4c2a8f 2015-03-06T21:29:25 Emscripten: Fixed ignoring return value of internal function. If the function Emscripten_ConvertUTF32toUTF8() failed (should currently not be possible) a not terminated string would have been sent as text input event.
Philipp Wiesemann 1686af72 2015-03-06T21:26:37 Emscripten: Partially fixed not removing key event callbacks if hint was used. The key event callbacks were always removed from the same target although it is possible to set them to different targets using the hint. This is only a partial fix because it assumes that the hint is not changed to a different value later.
Philipp Wiesemann bd2d0146 2015-02-15T21:44:36 Emscripten: Changed return type of callback implementations from int to EM_BOOL. The prototypes are declared with EM_BOOL (which is currently an int) in html5.h.
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.
Ryan C. Gordon fe40a172 2014-12-18T00:19:52 Initial merge of Emscripten port! With this commit, you can compile SDL2 with Emscripten ( http://emscripten.org/ ), and make your SDL-based C/C++ program into a web app. This port was due to the efforts of several people, including: Charlie Birks, Sathyanarayanan Gunasekaran, Jukka Jyl?nki, Alon Zakai, Edward Rudd, Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)