Skip to content

Commit 4fb2709

Browse files
authored
Merge pull request #65 from Paliak/expose-screenshot-func
Expose sceenshot funcitonality to lua. Remove screenshot hotkey.
2 parents bf09102 + 658da2d commit 4fb2709

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ui_api.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,13 @@ static int l_Exit(lua_State* L)
18941894
return 0;
18951895
}
18961896

1897+
static int l_TakeScreenshot(lua_State* L)
1898+
{
1899+
ui_main_c* ui = GetUIPtr(L);
1900+
ui->sys->con->Execute("screenshot");
1901+
return 0;
1902+
}
1903+
18971904
// ==============================
18981905
// Library and API Initialisation
18991906
// ==============================
@@ -2067,6 +2074,7 @@ int ui_main_c::InitAPI(lua_State* L)
20672074
ADDFUNC(SpawnProcess);
20682075
ADDFUNC(OpenURL);
20692076
ADDFUNC(SetProfiling);
2077+
ADDFUNC(TakeScreenshot);
20702078
ADDFUNC(Restart);
20712079
ADDFUNC(Exit);
20722080
lua_getglobal(L, "os");

ui_main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,6 @@ void ui_main_c::KeyEvent(int key, int type)
515515
break;
516516
case KE_KEYUP:
517517
switch (key) {
518-
case KEY_PRINTSCRN:
519-
sys->con->Execute("screenshot");
520-
break;
521518
case KEY_F10:
522519
renderer->ToggleDebugImGui();
523520
break;

0 commit comments

Comments
 (0)