Skip to content

Commit 722b643

Browse files
authored
fix(input): maximum sleep delay on backoff 0.1 seconds (#69)
Current setting of 0.2 sometimes makes the response feel sluggish.
1 parent 477dc9f commit 722b643

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ The scope of what is covered by the version number excludes:
2727

2828
## Version history
2929

30+
### version x.x.x, unreleased
31+
32+
- Fix: maximum key-delay, reduced from 0.2 to 0.1 seconds to reduce slugginess feel on some key presses.
33+
3034
### version 0.6.2, released 15-Apr-2025
3135

32-
- Fix: autotermrestore didn't work because its metatable was overwritten.
36+
- Fix: autotermrestore didn't work because its metatable was overwritten.
3337

3438
### version 0.6.1, released 13-Apr-2025
3539

system/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ end
239239
do
240240
--- Reads a single byte from the console, with a timeout.
241241
-- This function uses `fsleep` to wait until either a byte is available or the timeout is reached.
242-
-- The sleep period is exponentially backing off, starting at 0.0125 seconds, with a maximum of 0.2 seconds.
242+
-- The sleep period is exponentially backing off, starting at 0.0125 seconds, with a maximum of 0.1 seconds.
243243
-- It returns immediately if a byte is available or if `timeout` is less than or equal to `0`.
244244
--
245245
-- Using `system.readansi` is preferred over this function. Since this function can leave stray/invalid
@@ -263,7 +263,7 @@ do
263263
return nil, err
264264
end
265265
timeout = timeout - interval
266-
interval = math.min(0.2, interval * 2)
266+
interval = math.min(0.1, interval * 2)
267267
key = system._readkey()
268268
end
269269

0 commit comments

Comments
 (0)