Ryan C. Gordon
599d9ba198
emscripten: listen for pointerlockchange events on the #document specifically.
2017-06-05 21:30:25 -04:00
Philipp Wiesemann
759319729c
emscripten: Fixed compiling on C89 compilers.
2017-05-26 22:45:40 +02:00
Charlie Birks
126e5a1dbf
Emscripten: Prevent default on arrow keys
2017-05-24 14:04:39 +01:00
Patrick Monaghan
f839b209b9
Emscripten: fixed incorrect conversion of touch motion events to mouse motion events
2017-05-24 14:04:25 +01:00
Philipp Wiesemann
29222db7f6
emscripten: Fixed not removing pointer lock event callback.
2017-05-13 23:00:35 +02:00
Philipp Wiesemann
cc5b4f450a
emscripten: Changed internal functions to be static.
2017-05-12 23:01:17 +02:00
Ryan C. Gordon
93a6191cdc
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.
2017-04-20 13:00:54 -04:00
Charlie Birks
613955b4f2
Emscripten: only update pixel ratio if HiDPI is enabled
2017-02-17 10:13:07 +00:00
Sam Lantinga
45b774e3f7
Updated copyright for 2017
2017-01-01 18:33:28 -08:00
Philipp Wiesemann
c345126266
Emscripten: Fixed handling of deactivated mouse events.
...
SDL_GetEventState() was called with a button state instead of an event type.
2016-11-18 00:05:28 +01:00
Csongor Szabo
01f6273675
emscripten: check if device pixel ratio has changed
2016-10-14 17:06:28 +01:00
Sam Lantinga
00791f3a87
Only prevent the default browser event handling when the specific event types aren't disabled by the user, patch contributed by Jonas Platte
2016-09-13 00:09:21 -07:00
Charlie Birks
993dd83510
Add mapping for media keys
2016-09-13 00:04:00 -07:00
Jukka Jyl?nki
7cf44f1b4a
Remove unused variable warning from Emscripten build in Emscripten_HandleFullscreenChange().
2016-09-13 00:03:51 -07:00
Boris Gjenero
b54eb82c67
Unpress all keys on blur to avoid stuck keys
2016-09-13 00:03:49 -07:00
Boris Gjenero
a0a75f384f
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.
2016-09-13 00:03:48 -07:00
Boris Gjenero
3e5c4cec94
Mouse events use CSS coordinates, so don't scale by pixel_ratio
2016-09-13 00:03:46 -07:00
Boris Gjenero
a20c40c494
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.
2016-09-13 00:03:45 -07:00
TelpeNight
443998ff33
Fix of mouse events in browser without pointer locks
2016-09-13 00:03:44 -07:00
Charlie Birks
98ec844388
send mouse move on enter/leave
2016-09-13 00:03:39 -07:00
Charlie Birks
a2ef0db8a8
listen for mouse up on document (fixes mouseup outside canvas)
2016-09-13 00:03:37 -07:00
Charlie Birks
cd05184f9b
use SDL_SetMouseFocus
2016-09-13 00:03:36 -07:00
Sam Lantinga
bdca510fd6
simplify fullscreen handling using new fullscreen_strategy api, patch contributed by Charlie Birks
2016-09-13 00:03:28 -07:00
Charlie Birks
be08cc61f9
use css size for touch normalisation
2016-09-12 23:58:08 -07:00
Ryan C. Gordon
d05ae1941c
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.)
2016-08-12 19:59:00 -04:00
Sam Lantinga
42065e785d
Updated copyright to 2016
2016-01-02 10:10:34 -08:00
Philipp Wiesemann
0e45984fa0
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().
2015-06-21 17:33:46 +02:00