Skip to content

Add: add more const Key support#761

Merged
vcaesar merged 1 commit intomasterfrom
bitmap-pr
Mar 2, 2026
Merged

Add: add more const Key support#761
vcaesar merged 1 commit intomasterfrom
bitmap-pr

Conversation

@vcaesar
Copy link
Copy Markdown
Member

@vcaesar vcaesar commented Mar 2, 2026

Please provide Issues links to:

  • Issues: #

Provide test code:

Description

...

Summary by CodeRabbit

  • New Features
    • Added keyboard key constants for grave accent, double quote, and single quote characters to expand input handling capabilities.

Copilot AI review requested due to automatic review settings March 2, 2026 18:51
@gemini-code-assist
Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@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 this to the v1.10.0 milestone Mar 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

Note

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

📥 Commits

Reviewing files that changed from the base of the PR and between e692133 and a56d54d.

📒 Files selected for processing (1)
  • key.go
 ________________________________________________________________
< I like what you did here. I don't like *that* you did it here. >
 ----------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

✏️ Tip: You can disable in-progress messages and the fortune message in your review settings.

Tip

You can customize the tone of the review comments and chat replies.

Configure the tone_instructions setting to customize the tone of the review comments and chat replies. For example, you can set the tone to Act like a strict teacher, Act like a pirate and more.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bitmap-pr

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.

@vcaesar vcaesar merged commit 7dee03f into master Mar 2, 2026
7 of 11 checks passed
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 extends the exported key-constant set in key.go to include additional printable keys (grave and quote variants), presumably to make KeyTap/KeyToggle usage more ergonomic and less error-prone for callers.

Changes:

  • Reformats numeric key constants (Key0Key9) for alignment/readability.
  • Adds new exported constants for grave/backtick and quote characters.

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

Comment thread key.go
Key8 = "8"
Key9 = "9"
KeyGrave = "`"
KeyQuoter = '"'
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

KeyQuoter is declared as a rune constant ('"') rather than a string, while the surrounding key constants are strings. This will prevent using KeyQuoter anywhere a string is required (e.g., KeyTap(KeyQuoter) will not compile). Use a string literal for the double-quote character instead (e.g., an escaped " string).

Suggested change
KeyQuoter = '"'
KeyQuoter = "\""

Copilot uses AI. Check for mistakes.
Comment thread key.go
Comment on lines +100 to +102
KeyGrave = "`"
KeyQuoter = '"'
KeyQuote = "'"
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The name KeyQuoter is unclear/inconsistent next to KeyQuote (single quote). Consider renaming to something explicit like “double quote” to avoid confusion for API consumers.

Suggested change
KeyGrave = "`"
KeyQuoter = '"'
KeyQuote = "'"
KeyGrave = "`"
KeyQuoter = '"' // legacy name for double quote
KeyDoubleQuote = string('"') // clearer name for double quote
KeyQuote = "'"

Copilot uses AI. Check for mistakes.
Comment thread key.go
Key8 = "8"
Key9 = "9"
KeyGrave = "`"
KeyQuoter = '"'
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

There are existing unit tests asserting key constants (e.g., Key0, KeyA in robotgo_test.go). Adding assertions for the newly introduced constants (KeyGrave, the quote constants) would help catch accidental regressions in these exported API values.

Suggested change
KeyQuoter = '"'
KeyQuoter = `"`

Copilot uses AI. Check for mistakes.
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