Skip to content

Commit

Permalink
Continue 6095
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Jan 24, 2023
1 parent 8891d36 commit a2ba494
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
drkns 24.01.2023 20:29:40 +0000 - build 6097

1. Continue 6095.

--------------------------------------------------------------------------------
MZK 22.01.2023 09:32:07 -0800 - build 6096

Expand Down
15 changes: 0 additions & 15 deletions far/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,7 @@ static bool CASHook(const Manager::Key& key)
{
for (;;)
{
// Maximum keyboard rate is ~30 Hz (every ~33 ms).
// Ideally the delay should be slightly shorter than that,
// to not consume too many cycles, but still process the events faster than they come.
// However, mouse rate is typically higher, 125 Hz or more (every 8 ms).
// In theory, the user can do goofy things while holding CAD,
// e.g. quickly move the mouse, filling the queue faster than we read it.

// 10 ms is picked experimentally, it seems to be a good compromise.
// TODO: consider suppressing the mouse and raising the delay to 25-30.
os::chrono::sleep_for(10ms);

INPUT_RECORD Record;

if (!PeekInputRecord(&Record, true))
continue;

GetInputRecord(&Record, true, true);

if (Record.EventType != KEY_EVENT)
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6096
6097

0 comments on commit a2ba494

Please sign in to comment.