mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 16:49:01 -06:00
Apparently macs don't have a printscreen key, screenshot bound to f12 now instead
This commit is contained in:
parent
682c4a485a
commit
fa2fe77081
16
main.lua
16
main.lua
@ -150,20 +150,20 @@ function love.keypressed(key, scancode)
|
|||||||
scene.restart_message = true
|
scene.restart_message = true
|
||||||
if config.secret then playSE("mode_decide")
|
if config.secret then playSE("mode_decide")
|
||||||
else playSE("erase") end
|
else playSE("erase") end
|
||||||
-- function keys are reserved
|
-- f12 is reserved for saving screenshots
|
||||||
elseif string.match(scancode, "^f[1-9]$") or string.match(scancode, "^f[1-9][0-9]+$") then
|
elseif scancode == "f12" 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
|
|
||||||
local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png")
|
local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png")
|
||||||
if not love.filesystem.getInfo("ss") then
|
if not love.filesystem.getInfo("ss") then
|
||||||
love.filesystem.createDirectory("ss")
|
love.filesystem.createDirectory("ss")
|
||||||
end
|
end
|
||||||
print("Saving screenshot as "..ss_name)
|
print("Saving screenshot as "..ss_name)
|
||||||
GLOBAL_CANVAS:newImageData():encode("png", 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
|
-- pass any other key to the scene, with its configured mapping
|
||||||
else
|
else
|
||||||
local input_pressed = nil
|
local input_pressed = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user