Skip to content

Commit

Permalink
Modified keybindings to be more layout-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixola committed Jan 7, 2020
1 parent e867c23 commit 8c9236a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fullscreen: %s (toggle with ctrl+f)
busy wait: %s (toggle with b)
vsync: %s (toggle with s)
fluctuating: %s (toggle with f, change max with ctrl + up/down arrow, change speed with ctrl + left/right arrow)
random stutter: %s [%dms] (toggle with r, change max amount with ctrl + +/-, shift to change faster)
random stutter: %s [%dms] (toggle with r, change max amount with alt + up/down arrow, shift to change faster)
Freesync will only work when the application is fullscreen on Linux.
Busy waiting is more precise, but much heavier on processor and battery.
Expand Down Expand Up @@ -146,6 +146,7 @@ love.keypressed = function(key, keycode)

local ctrl = love.keyboard.isDown("lctrl", "rctrl")
local shift = love.keyboard.isDown("lshift", "rshift")
local alt = love.keyboard.isDown("ralt", "lalt")

if ctrl then
if key == "up" then
Expand All @@ -156,10 +157,6 @@ love.keypressed = function(key, keycode)
fpsSpeed = fpsSpeed - 1
elseif key == "right" then
fpsSpeed = fpsSpeed + 1
elseif key == "+" then
randomAmount = randomAmount + (shift and 5 or 1)
elseif key == "-" then
randomAmount = randomAmount - (shift and 5 or 1)
elseif key == "f" then
if fullscreen then
love.window.setFullscreen(false)
Expand All @@ -170,6 +167,12 @@ love.keypressed = function(key, keycode)
end
fullscreen = not fullscreen
end
elseif alt then
if key == "up" then
randomAmount = randomAmount + (shift and 5 or 1)
elseif key == "down" then
randomAmount = randomAmount - (shift and 5 or 1)
end
else
if key == "up" then
fps = fps + 1
Expand Down

0 comments on commit 8c9236a

Please sign in to comment.