Browse Source

Add love.mousefocus (partial issue #120) temporary name (see issue #573) and it's waiting for an exposed love.window to get a check, too

Bart van Strien 12 years ago
parent
commit
79d1a7a6ef
3 changed files with 11 additions and 0 deletions
  1. 2 0
      src/modules/event/sdl/Event.cpp
  2. 3 0
      src/scripts/boot.lua
  3. 6 0
      src/scripts/boot.lua.h

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

@@ -180,6 +180,8 @@ Message *Event::convert(SDL_Event &e)
 		arg1 = new Variant(e.active.gain != 0);
 		arg1 = new Variant(e.active.gain != 0);
 		if (e.active.state & SDL_APPINPUTFOCUS)
 		if (e.active.state & SDL_APPINPUTFOCUS)
 			msg = new Message("focus", arg1);
 			msg = new Message("focus", arg1);
+		else if (e.active.state & SDL_APPMOUSEFOCUS)
+			msg = new Message("mousefocus", arg1);
 		arg1->release();
 		arg1->release();
 		break;
 		break;
 	case SDL_QUIT:
 	case SDL_QUIT:

+ 3 - 0
src/scripts/boot.lua

@@ -185,6 +185,9 @@ function love.createhandlers()
 		focus = function (f)
 		focus = function (f)
 			if love.focus then love.focus(f) end
 			if love.focus then love.focus(f) end
 		end,
 		end,
+		mousefocus = function (f)
+			if love.mousefocus then love.mousefocus(f) end
+		end,
 		quit = function ()
 		quit = function ()
 			return
 			return
 		end,
 		end,

+ 6 - 0
src/scripts/boot.lua.h

@@ -327,6 +327,12 @@ const unsigned char boot_lua[] =
 	0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x28, 0x66, 0x29, 0x20, 
 	0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x28, 0x66, 0x29, 0x20, 
 	0x65, 0x6e, 0x64, 0x0a,
 	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, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 
+	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x66, 0x29, 0x0a,
+	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x66, 0x6f, 
+	0x63, 0x75, 0x73, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 
+	0x65, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x28, 0x66, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
+	0x09, 0x09, 0x65, 0x6e, 0x64, 0x2c, 0x0a,
 	0x09, 0x09, 0x71, 0x75, 0x69, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 
 	0x09, 0x09, 0x71, 0x75, 0x69, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 
 	0x28, 0x29, 0x0a,
 	0x28, 0x29, 0x0a,
 	0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a,
 	0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a,