Skip to content

Conversation

hemanth5055
Copy link
Contributor

@hemanth5055 hemanth5055 commented Aug 6, 2025

Summary

I've added a keyboard shortcut (Alt+T / Option+T) to activate the code selection mode in the extension.

Details

  • Defined a new command enable-code-selection in manifest.json
  • Assigned the shortcut key for both default and macOS platforms (Alt maps to Option on macOS)
  • Added a command listener in the background script to trigger the picker

Please review the changes and let me know if there's anything I can improve or refine. 🙂
closes #14

Copy link
Collaborator

@dineshsutihar dineshsutihar left a comment

Choose a reason for hiding this comment

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

Hey @hemanth5055,

Thanks a lot for the PR, I really appreciate your work on adding the Alt+T shortcut! 🙌

However, I realized that Alt+T can conflict with some browser behavior (especially the Tools menu on Chrome/Edge). To ensure better cross-platform compatibility and avoid accidental browser interactions, I’ve decided to switch to a safer and more ergonomic shortcut.

🔄 New shortcut for TranslateAlt + Shift + A (Please use this now)

You only need to update the Translate shortcut for now, we’ll add others like Explain and Settings later.

Also, please explicitly include the shortcut for macOS as well. Here’s the updated manifest.json snippet:

"translate": {
  "suggested_key": {
    "default": "Alt+Shift+A",
    "mac": "Alt+Shift+A"
  },
  "description": "Translate selected text"
}

Copy link
Collaborator

@dineshsutihar dineshsutihar left a comment

Choose a reason for hiding this comment

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

LGTM

@dineshsutihar dineshsutihar merged commit 3edcf13 into StructZ:develop Aug 7, 2025
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.

Feature: Add a keyboard shortcut to enable the code selector

2 participants