aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-24 17:56:45 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-24 18:05:49 -0800
commit6b714f2d6911b6e6d301065d6388aa44724b7642 (patch)
treec0c6f01ca6fdbcd83dd165f100a6bf5d8a37f362 /src/library_sdl.js
parent29d731f8a83aaeec772c20936730d88f5f7c7171 (diff)
fix SDL_GetMouseState ; fixes #795
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 712ec290..86144bf7 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -483,7 +483,7 @@ var LibrarySDL = {
// correct.
SDL.buttonState |= 1 << event.button;
} else if (event.type == 'mouseup') {
- SDL.buttonState = 0;
+ SDL.buttonState &= ~(1 << event.button);
}
// fall through
case 'mousemove': {
@@ -883,7 +883,7 @@ var LibrarySDL = {
SDL_GetMouseState: function(x, y) {
if (x) {{{ makeSetValue('x', '0', 'SDL.mouseX', 'i32') }}};
if (y) {{{ makeSetValue('y', '0', 'SDL.mouseY', 'i32') }}};
- return 0;
+ return SDL.buttonState;
},
SDL_WarpMouse: function(x, y) {