[FEAT] cnt() i rst()

This commit is contained in:
2021-12-20 18:15:39 +01:00
parent 82bebe3eeb
commit 841f4f66f3
3 changed files with 28 additions and 2 deletions

13
lua.cpp
View File

@@ -392,6 +392,16 @@ extern "C" {
lua_pushstring(L, fromclipboard());
return 1;
}
static int cpp_cnt(lua_State *L) {
lua_pushinteger(L, cnt());
return 1;
}
static int cpp_rst(lua_State *L) {
rst();
return 0;
}
}
#define STATE_STOPPED 0
@@ -485,6 +495,9 @@ void lua_init(const char* filename, const bool start_playing) {
lua_pushcfunction(L,cpp_toclipboard); lua_setglobal(L, "toclipboard");
lua_pushcfunction(L,cpp_fromclipboard); lua_setglobal(L, "fromclipboard");
lua_pushcfunction(L,cpp_cnt); lua_setglobal(L, "cnt");
lua_pushcfunction(L,cpp_rst); lua_setglobal(L, "rst");
lua_pushinteger(L, 0); lua_setglobal(L, "KEY_UNKNOWN");
lua_pushinteger(L, 4); lua_setglobal(L, "KEY_A");
lua_pushinteger(L, 5); lua_setglobal(L, "KEY_B");