Skip to content

Commit

Permalink
Change key repeat to 10ms
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro committed Jan 15, 2025
1 parent 619b3c0 commit 72ef9c8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/game_walk/walk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,21 @@ end
function bindWalkKey(key, dir)
local gameRootPanel = modules.game_interface.getRootPanel()
g_keyboard.bindKeyDown(key, function()
g_keyboard.setKeyDelay(key, 10)
changeWalkDir(dir)
end, gameRootPanel, true)
g_keyboard.bindKeyUp(key, function()
g_keyboard.setKeyDelay(key, 30)
changeWalkDir(dir, true)
end, gameRootPanel, true)
g_keyboard.bindKeyPress(key, function(_, _, ticks) smartWalk(dir, ticks) end, gameRootPanel)

g_keyboard.setKeyDelay(key, 30)
end

function unbindWalkKey(key)
local gameRootPanel = modules.game_interface.getRootPanel()
g_keyboard.unbindKeyDown(key, gameRootPanel)
g_keyboard.unbindKeyUp(key, gameRootPanel)
g_keyboard.unbindKeyPress(key, gameRootPanel)

g_keyboard.setKeyDelay(key, 30)
end

function bindTurnKey(key, dir)
Expand Down

0 comments on commit 72ef9c8

Please sign in to comment.