From fa2fe770815738bbc83665c18fa5d936d1eb0b55 Mon Sep 17 00:00:00 2001 From: Oshisaure Date: Fri, 29 Jan 2021 22:29:27 +0000 Subject: [PATCH] Apparently macs don't have a printscreen key, screenshot bound to f12 now instead --- main.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.lua b/main.lua index 5ef7eb7..e8a4dcd 100644 --- a/main.lua +++ b/main.lua @@ -150,20 +150,20 @@ function love.keypressed(key, scancode) scene.restart_message = true if config.secret then playSE("mode_decide") else playSE("erase") end - -- function keys are reserved - elseif string.match(scancode, "^f[1-9]$") or string.match(scancode, "^f[1-9][0-9]+$") then - return - -- escape is reserved for menu_back - elseif scancode == "escape" then - scene:onInputPress({input="menu_back", type="key", key=key, scancode=scancode}) - -- printscreen is reserved for printing the screen i know impressive keybind - elseif scancode == "printscreen" then + -- f12 is reserved for saving screenshots + elseif scancode == "f12" then local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png") if not love.filesystem.getInfo("ss") then love.filesystem.createDirectory("ss") end print("Saving screenshot as "..ss_name) GLOBAL_CANVAS:newImageData():encode("png", ss_name) + -- function keys are reserved + elseif string.match(scancode, "^f[1-9]$") or string.match(scancode, "^f[1-9][0-9]+$") then + return + -- escape is reserved for menu_back + elseif scancode == "escape" then + scene:onInputPress({input="menu_back", type="key", key=key, scancode=scancode}) -- pass any other key to the scene, with its configured mapping else local input_pressed = nil