Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix key handling for CTRL and CMD keys #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chavan-arvind
Copy link

@chavan-arvind chavan-arvind commented Oct 24, 2024

Fixes #12

Update performAction and runAgent functions to handle 'ctrl' and 'cmd' keys for Mac OS.

  • Key Mapping:

    • Add 'ctrl' and 'cmd' keys to the keyMap in performAction function.
    • Map 'ctrl' to Key.LeftControl and 'cmd' to Key.LeftSuper.
  • Mac OS Specific Logic:

    • Add logic in runAgent function to replace 'ctrl' with 'cmd' for Mac OS.

Fixes corbt#12

Update `performAction` and `runAgent` functions to handle 'ctrl' and 'cmd' keys for Mac OS.

* **Key Mapping:**
  - Add 'ctrl' and 'cmd' keys to the `keyMap` in `performAction` function.
  - Map 'ctrl' to `Key.LeftControl` and 'cmd' to `Key.LeftSuper`.

* **Mac OS Specific Logic:**
  - Add logic in `runAgent` function to replace 'ctrl' with 'cmd' for Mac OS.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/corbt/agent.exe/issues/12?shareId=XXXX-XXXX-XXXX-XXXX).
@physics-coder
Copy link

physics-coder commented Oct 24, 2024

Replacing super and its variations (commands containing super, such as L_super) with cmd could also be added for mac, because Claude loves trying to press it for opening spotlight for example. Also, perhaps add arrows and Tab for DE and app navigation.

@@ -246,6 +248,12 @@ export const runAgent = async (
if (!getState().running) {
break;
}

// Replace 'ctrl' with 'cmd' for Mac OS
if (process.platform === 'darwin' && action.type === 'key') {
Copy link
Owner

Choose a reason for hiding this comment

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

This should happen in the key mapping on line 183 I think?

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.

Request fails when trying to use CTRL or CMD keys
3 participants