event.register(event.mousedown, function(...) print(...) end) event.unregister(event.mousedown, somefunc) mouseclick event split into mousedown, mouseup, mousemove, mousewheel keypress event split into keypress, keyrelease, textinput. key* events only contain keycode and scancode, don't attempt to represent a letter (was very broken at this before). Also have helpful shift/ctrl/alt flags passed in. textinput just represents inserted text, can probably even handle foreign characters. register_step replaced with event.tick event All legacy register_* and unregister_ functions are removed. There is a compatibility lua script, might embed it later. tpt.set_shortcuts / tpt.test also removed. event.getmodifiers added, just a misc function to get the currently held modifiers Lots of code duplication to handle each event is removed, it's not handled in a more generic way. Although the Event class / child classes could use some work.
39 lines
719 B
C
39 lines
719 B
C
#ifndef LUAINC_H
|
|
#define LUAINC_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#if defined(LUA_R_INCL)
|
|
#include "lua.h"
|
|
#include "lauxlib.h"
|
|
#include "lualib.h"
|
|
#elif defined(LUA_COMPAT_ALL)
|
|
#include "lua5.2/lua.h"
|
|
#include "lua5.2/lauxlib.h"
|
|
#include "lua5.2/lualib.h"
|
|
#elif defined(LUAJIT)
|
|
#include "luajit-2.0/lua.h"
|
|
#include "luajit-2.0/lauxlib.h"
|
|
#include "luajit-2.0/lualib.h"
|
|
#else
|
|
#include "lua5.1/lua.h"
|
|
#include "lua5.1/lauxlib.h"
|
|
#include "lua5.1/lualib.h"
|
|
#endif
|
|
|
|
#if LUA_VERSION_NUM >= 502
|
|
LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
|
|
#else
|
|
LUALIB_API void (lua_pushglobaltable) (lua_State *L);
|
|
#endif
|
|
int luaL_tostring(lua_State *L, int n);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|