[FEATURE] toclipboard & fromclipboard
This commit is contained in:
13
lua.cpp
13
lua.cpp
@@ -381,6 +381,17 @@ extern "C" {
|
||||
filein(str, addr, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_toclipboard(lua_State *L) {
|
||||
const char* str = luaL_checkstring(L, 1);
|
||||
toclipboard(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_fromclipboard(lua_State *L) {
|
||||
lua_pushstring(L, fromclipboard());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
#define STATE_STOPPED 0
|
||||
@@ -473,6 +484,8 @@ void lua_init(const char* filename, const bool start_playing) {
|
||||
|
||||
lua_pushcfunction(L,cpp_fileout); lua_setglobal(L, "fileout");
|
||||
lua_pushcfunction(L,cpp_filein); lua_setglobal(L, "filein");
|
||||
lua_pushcfunction(L,cpp_toclipboard); lua_setglobal(L, "toclipboard");
|
||||
lua_pushcfunction(L,cpp_fromclipboard); lua_setglobal(L, "fromclipboard");
|
||||
|
||||
lua_pushinteger(L, 0); lua_setglobal(L, "KEY_UNKNOWN");
|
||||
lua_pushinteger(L, 4); lua_setglobal(L, "KEY_A");
|
||||
|
||||
Reference in New Issue
Block a user