[lua] Add KeyEvent.repeatCount (fix aseprite/api#95)

As "repeat" is a keyword on Lua, it makes things complicated.
This commit is contained in:
David Capello 2023-03-16 14:55:30 -03:00
parent 87251e52be
commit b7770f5fac

View File

@ -1016,7 +1016,10 @@ static void fill_keymessage_values(lua_State* L, const ui::KeyMessage* msg)
// KeyMessage specifics
lua_pushinteger(L, msg->repeat());
lua_setfield(L, -2, "repeat");
lua_setfield(L, -2, "repeat"); // Only for backward compatibility, remove this in a future
lua_pushinteger(L, msg->repeat());
lua_setfield(L, -2, "repeatCount");
// TODO improve this (create an Event metatable)
lua_pushcfunction(L, [](lua_State*) -> int {