Skip to content

fix: correct keylog defaults and keycode labeling#1

Merged
Sinity merged 2 commits into
masterfrom
fix/keylog-default-path-and-labels
May 5, 2026
Merged

fix: correct keylog defaults and keycode labeling#1
Sinity merged 2 commits into
masterfrom
fix/keylog-default-path-and-labels

Conversation

@Sinity
Copy link
Copy Markdown
Owner

@Sinity Sinity commented May 5, 2026

Summary
Correct scribe-tap's default keylog location and fix evdev keycode labeling for reconstruction/replay.

Problem
The project still documented and defaulted to /realm/data/keylog while the current data-lake location is /realm/data/captures/keylog. The installed keycode labeling also assumed KEY_A..KEY_Z were contiguous evdev codes, which broke recovered text reconstruction.

Solution
Point source/docs/replay defaults at /realm/data/captures/keylog, ignore generated agent files, and label keycodes through libevdev's key-name surface instead of contiguous letter arithmetic. Ctrl/Alt modified keypresses remain raw events without appending control-code text into the live buffer.

Verification
make check

Point the default capture paths at /realm/data/captures/keylog and fix evdev letter labeling so replay/reconstruction sees the actual key names. Also avoid appending Ctrl/Alt control-code text into the live buffer while preserving the raw key events for reconstruction.
Copilot AI review requested due to automatic review settings May 5, 2026 22:27
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 38 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 47ea87a7-583c-4163-8f7e-f39772bdbf88

📥 Commits

Reviewing files that changed from the base of the PR and between 8ecc697 and 4eebffa.

📒 Files selected for processing (6)
  • .gitignore
  • AGENTS.md
  • README.md
  • src/main.c
  • src/state.c
  • tools/replay.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/keylog-default-path-and-labels

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

When callers pass both --log-dir and --snapshot-dir, do not create the default data root just because --data-dir was omitted. This keeps CI and explicit test runs from trying to mkdir the workstation-only /realm path.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ff1f88f1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/state.c
Comment on lines +876 to +880
} else if (state->modifiers[MOD_CTRL] || state->modifiers[MOD_ALT]) {
/* Skip buffer append when Ctrl or Alt is held — xkbcommon returns
control codes (0x01-0x1f) that corrupt the buffer. The press event
still logs the keycode for reconstruction from raw events. */
break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow AltGr text entry in buffer updates

The new state->modifiers[MOD_ALT] guard skips all text appends whenever Alt is pressed, which regresses input on international layouts where Right Alt (AltGr) is required to produce normal characters (for example @, , or locale-specific letters). In those sessions, keypresses are still logged but snapshots/buffer reconstruction lose actual typed text, so the captured output becomes incomplete for common user workflows outside US layouts.

Useful? React with 👍 / 👎.

@Sinity Sinity merged commit befcaee into master May 5, 2026
6 checks passed
@Sinity Sinity deleted the fix/keylog-default-path-and-labels branch May 5, 2026 22:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates scribe-tap’s default capture/log locations to match the current data-lake layout and fixes how evdev keycodes are labeled in press events so replay/reconstruction can correctly interpret letter keys.

Changes:

  • Update default data-dir/replay defaults and documentation from /realm/data/keylog to /realm/data/captures/keylog.
  • Fix press event keycode labeling for A–Z by using an explicit evdev mapping instead of contiguous arithmetic.
  • Prevent Ctrl/Alt-modified XKB translations from being appended into the live buffer (but still log raw press events).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/replay.py Updates default log/snapshot paths to the new captures/keylog location.
src/state.c Fixes keycode labeling for letters; changes modifier handling during buffer reconstruction.
src/main.c Updates the default --data-dir root path.
README.md Updates documented defaults and replay examples to the new path.
AGENTS.md Adds a generated-file notice and updates the documented default path.
.gitignore Adds ignore rules for AGENTS files (but see comment re: tracked files).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/state.c
Comment on lines +876 to +880
} else if (state->modifiers[MOD_CTRL] || state->modifiers[MOD_ALT]) {
/* Skip buffer append when Ctrl or Alt is held — xkbcommon returns
control codes (0x01-0x1f) that corrupt the buffer. The press event
still logs the keycode for reconstruction from raw events. */
break;
Comment thread src/state.c
Comment on lines +876 to +879
} else if (state->modifiers[MOD_CTRL] || state->modifiers[MOD_ALT]) {
/* Skip buffer append when Ctrl or Alt is held — xkbcommon returns
control codes (0x01-0x1f) that corrupt the buffer. The press event
still logs the keycode for reconstruction from raw events. */
Comment thread src/state.c
{
char letter = lowercase_char_for_key(code);
if (letter >= 'a' && letter <= 'z') {
snprintf(buf, sizeof(buf), "KEY_%c", letter - 32); /* uppercase */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants