mirror of
https://github.com/Kiritow/LuaEngine.git
synced 2024-03-22 13:11:45 +08:00
LuaEngine v0.4.1
Add drop event support
This commit is contained in:
parent
d34aa416b6
commit
6be18a6b6a
32
Event.cpp
32
Event.cpp
|
@ -432,6 +432,38 @@ int unpack_event(lua_State* L, const SDL_Event& e)
|
||||||
lua_pushinteger(L, e.tfinger.timestamp);
|
lua_pushinteger(L, e.tfinger.timestamp);
|
||||||
return 9;
|
return 9;
|
||||||
}
|
}
|
||||||
|
case SDL_DROPTEXT:
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "droptext");
|
||||||
|
if (e.drop.file)
|
||||||
|
{
|
||||||
|
lua_pushstring(L, e.drop.file);
|
||||||
|
SDL_free(e.drop.file);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
case SDL_DROPFILE:
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "dropfile");
|
||||||
|
if (e.drop.file)
|
||||||
|
{
|
||||||
|
lua_pushstring(L, e.drop.file);
|
||||||
|
SDL_free(e.drop.file);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
case SDL_DROPBEGIN:
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "dropbegin");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
case SDL_DROPCOMPLETE:
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "dropend");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
case SDL_WINDOWEVENT:
|
case SDL_WINDOWEVENT:
|
||||||
{
|
{
|
||||||
switch (e.window.event)
|
switch (e.window.event)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user