Implement MOUSE callbacks (MOUSE_move, MOUSE_button_down, MOUSE_button_up) with new simple function LUA_callfunction:
int LUA_callfunction(lua_State *L, char *functionname, char *params, ...)

Example: LUA_callfunction(global_lua, "MOUSE_button_down", "iii", e.motion.x, e.motion.y, b);