Browse Source

Added a boolean argument to love.mousemoved indicating whether the event came from a touch press (love.mousepressed and love.mousereleased already have it.)

Alex Szpakowski 10 years ago
parent
commit
7e99ea6839
3 changed files with 6 additions and 5 deletions
  1. 1 0
      src/modules/event/sdl/Event.cpp
  2. 2 2
      src/scripts/boot.lua
  3. 3 3
      src/scripts/boot.lua.h

+ 1 - 0
src/modules/event/sdl/Event.cpp

@@ -239,6 +239,7 @@ Message *Event::convert(const SDL_Event &e) const
 			vargs.push_back(new Variant(y));
 			vargs.push_back(new Variant(y));
 			vargs.push_back(new Variant(xrel));
 			vargs.push_back(new Variant(xrel));
 			vargs.push_back(new Variant(yrel));
 			vargs.push_back(new Variant(yrel));
+			vargs.push_back(new Variant(e.motion.which == SDL_TOUCH_MOUSEID));
 			msg = new Message("mousemoved", vargs);
 			msg = new Message("mousemoved", vargs);
 		}
 		}
 		break;
 		break;

+ 2 - 2
src/scripts/boot.lua

@@ -166,8 +166,8 @@ function love.createhandlers()
 		textedit = function (t,s,l)
 		textedit = function (t,s,l)
 			if love.textedit then return love.textedit(t,s,l) end
 			if love.textedit then return love.textedit(t,s,l) end
 		end,
 		end,
-		mousemoved = function (x,y,xrel,yrel)
-			if love.mousemoved then return love.mousemoved(x,y,xrel,yrel) end
+		mousemoved = function (x,y,dx,dy,t)
+			if love.mousemoved then return love.mousemoved(x,y,dx,dy,t) end
 		end,
 		end,
 		mousepressed = function (x,y,b,t)
 		mousepressed = function (x,y,b,t)
 			if love.mousepressed then return love.mousepressed(x,y,b,t) end
 			if love.mousepressed then return love.mousepressed(x,y,b,t) end

+ 3 - 3
src/scripts/boot.lua.h

@@ -286,12 +286,12 @@ const unsigned char boot_lua[] =
 	0x6e, 0x64, 0x0a,
 	0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x2c, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x2c, 0x0a,
 	0x09, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 
 	0x09, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 
-	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x79, 0x2c, 0x78, 0x72, 0x65, 0x6c, 0x2c, 0x79, 0x72, 
-	0x65, 0x6c, 0x29, 0x0a,
+	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x79, 0x2c, 0x64, 0x78, 0x2c, 0x64, 0x79, 0x2c, 0x74, 
+	0x29, 0x0a,
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 
 	0x76, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 
 	0x76, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 
 	0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x28, 0x78, 0x2c, 0x79, 0x2c, 
 	0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x28, 0x78, 0x2c, 0x79, 0x2c, 
-	0x78, 0x72, 0x65, 0x6c, 0x2c, 0x79, 0x72, 0x65, 0x6c, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
+	0x64, 0x78, 0x2c, 0x64, 0x79, 0x2c, 0x74, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x2c, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x2c, 0x0a,
 	0x09, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x66, 
 	0x09, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x66, 
 	0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x79, 0x2c, 0x62, 0x2c, 0x74, 0x29, 0x0a,
 	0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x79, 0x2c, 0x62, 0x2c, 0x74, 0x29, 0x0a,