Skip to content

chore: move KeyPress/up/down() to key_pub.go and update AGENTS.md (key) - #809

Merged
vcaesar merged 5 commits into
masterfrom
wayland-win
Oct 7, 2026
Merged

vcaesar merged 5 commits into
masterfrom
wayland-win

Conversation

@vcaesar

@vcaesar vcaesar commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.

Please provide Issues links to:

  • Issues: #

Provide test code:

Description

...

Summary by CodeRabbit

  • New Features
    • Keyboard press, hold, and release controls are available through consistent APIs across supported platforms.
    • Added delayed-typing helpers and utilities for character indexing and Unicode-to-key-name conversion.
  • Changes
    • Pure-Go backends now share keyboard and mouse delay settings.
    • Sleep helpers and delay settings are no longer exposed separately by platform-specific backend packages.
  • Documentation
    • Documented macOS pure-Go window-management support and its Accessibility permission requirement, and clarified keyboard API behavior and testing guidance.

…y.go)

- Update AGENTS.md and 7 others

Generated with Codg
Assisted-by: claude-opus-5-5 via Codg <codg@atomai.cc>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 08:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vcaesar vcaesar added the update label Oct 7, 2026
@vcaesar vcaesar added this to the v2.0.0 milestone Oct 7, 2026
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d1f5b218-5cfc-4cdf-a4ac-c4c8a3badeb1
📥 Commits

Reviewing files that changed from the base of the PR and between 0f791ea and 3990360.

📒 Files selected for processing (9)
  • AGENTS.md
  • darwin.go
  • key.go
  • key_pub.go
  • libei.go
  • robotgo_purego_test.go
  • wayland_n.go
  • windows_n.go
  • x11_n.go
 __________________________________________________________________________
< Your code is like a magic trick: now you see it... now it's `undefined`. >
 --------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57a8c273-ff2e-48d7-b2dc-c850963605fc
📥 Commits

Reviewing files that changed from the base of the PR and between 66c3d27 and 0f791ea.

📒 Files selected for processing (27)
  • AGENTS.md
  • darwin/keyboard.go
  • darwin/mouse.go
  • darwin/robotgo.go
  • key_pub.go
  • key_pub_test.go
  • key_test.go
  • libei/keyboard.go
  • libei/mouse.go
  • libei/robotgo.go
  • libei/robotgo_test.go
  • pub/pub.go
  • pub/pub_test.go
  • robotgo_pub.go
  • robotgo_pub_test.go
  • robotgo_purego.go
  • robotgo_purego_test.go
  • wayland/keyboard.go
  • wayland/mouse.go
  • wayland/robotgo.go
  • wayland/robotgo_test.go
  • win/keyboard.go
  • win/mouse.go
  • win/robotgo.go
  • x11/keyboard.go
  • x11/mouse.go
  • x11/robotgo.go
💤 Files with no reviewable changes (5)
  • darwin/robotgo.go
  • win/robotgo.go
  • libei/robotgo.go
  • wayland/robotgo.go
  • x11/robotgo.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • AGENTS.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change adds build-tag-free keyboard and typing helpers, moves pure-Go backend delay handling to shared settings in pub, and removes backend-local delay variables and sleep helpers. It also updates architecture and macOS backend documentation.

Changes

Portable APIs and shared delay configuration

Layer / File(s) Summary
Portable key and typing helpers
key_pub.go, key.go, *_n.go, darwin.go, libei.go, key_pub_test.go, key_test.go, AGENTS.md
key_pub.go provides KeyDown, KeyUp, KeyPress, delayed typing, rune-index lookup, and Unicode conversion. Backend-specific key wrappers are removed. Tests and guidance are updated for the portable helpers.
Shared delay configuration and root APIs
pub/*, robotgo_pub.go, robotgo_purego.go, robotgo_pub_test.go, robotgo_purego_test.go, AGENTS.md
pub adds shared delay settings, sleep helpers, and SetDelay. Root sleep and delay APIs delegate to pub, and pure-Go initialization copies root settings into the shared package.
Backend keyboard delay handling
darwin/keyboard.go, libei/keyboard.go, wayland/keyboard.go, win/keyboard.go, x11/keyboard.go, backend tests
Keyboard implementations use pub.KeySleep and pub.MilliSleep. Backend-local keyboard delay settings and SetDelay functions are removed.
Backend mouse delay handling
darwin/mouse.go, libei/mouse.go, wayland/mouse.go, win/mouse.go, x11/mouse.go
Mouse implementations use pub.MouseSleep and pub.MilliSleep. Backend-local MouseSleep settings are removed.
Backend sleep helper removal
darwin/robotgo.go, libei/robotgo.go, wayland/robotgo.go, win/robotgo.go, x11/robotgo.go
Backend packages remove their exported Sleep and MilliSleep functions.

macOS backend documentation

Layer / File(s) Summary
macOS window-management documentation
AGENTS.md
The documentation describes macOS pure-Go window management through Accessibility and AppKit and states the Accessibility permission requirement.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Merge Risk: 🔵 Low · up to 0f791

Concurrent delay changes can leave keyboard timing at an older setting. This is a bounded risk that can be accepted or addressed as a follow-up.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description retains the template warning and provides no substantive summary, issue link or rationale, or test code. Remove the template boilerplate. Add an English summary of the changes, link the target issue or explain why there is no issue, and provide test code or describe the tests run. Also confirm the pull request targets master and follows the co…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the move of KeyPress, KeyUp, and KeyDown to key_pub.go and the AGENTS.md update.
Docstring Coverage ✅ Passed Docstring coverage is 85.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 100 functions across 26 files. (1 skipped: …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Resolution

Remove the template boilerplate. Add an English summary of the changes, link the target issue or explain why there is no issue, and provide test code or describe the tests run. Also confirm the pull request targets master and follows the contribution and CLA requirements.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

KeyPress introduces unresolved X11 behavior and synchronization regressions.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)

Comment thread key_pub.go Outdated
Comment thread key_pub.go Outdated
- Add darwin.go, pub_test.go
- Update AGENTS.md and 22 others

Generated with Codg
Assisted-by: claude-opus-555 via Codg <codg@atomai.cc>
- Update key_pub.go and 4 others

Generated with Codg
Assisted-by: claude-opus-5-5 via Codg <codg@atomai.cc>
- Update AGENTS.md and 8 others

Generated with Codg
Assisted-by: claude-opus-5-5 via Codg <codg@atomai.cc>
@vcaesar
vcaesar merged commit 1a263fd into master Oct 7, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants