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

Add Keyboard Shortcuts for Deasciify Features in Firefox #35

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

umitaltintas
Copy link

@umitaltintas umitaltintas commented Mar 15, 2023

Feature: Add keyboard shortcuts for Deasciify features in Firefox

This pull request adds keyboard shortcuts for two features in the Firefox extension:

  1. Deasciify Selected Text
    • Shortcut: Alt+Shift+D (Command+Alt+D on Mac)
  2. Toggle Auto-Deasciify
    • Shortcut: Alt+Shift+A (Command+Alt+A on Mac)

These shortcuts allow users to quickly and easily access the extension's core functionalities without having to interact with the context menu or toolbar button.

Changes made:

  1. Added listeners for the new shortcuts in background.js:
browser.commands.onCommand.addListener(function (command) {
  if (command === "DEASCIIFY_SELECTED_TOGGLE") {
  ConvertTurkishChars();
  }
 if (command === "AUTO_DEASCIIFY_TOGGLE") {
   browser.tabs.executeScript({ file: "execute.js" }, function () {
     browser.tabs.executeScript({ code: "toggleAutoDeasciify();" });
   });
 }
});
  1. Added shortcut definitions in manifest.js:
"commands": {
  "DEASCIIFY_SELECTED_TOGGLE": {
    "suggested_key": {
      "default": "Alt+Shift+D",
      "mac": "Command+Alt+D"
    },
  "description": "Deasciify the selected text"
  },
  "AUTO_DEASCIIFY_TOGGLE": {
    "suggested_key": {
      "default": "Alt+Shift+A",
      "mac": "Command+Alt+A"
    },
  "description": "Toggle auto-deasciify"
  }
}

Please review the changes and let me know if you have any feedback or if any further changes are required.

Thank you!

@umitaltintas umitaltintas changed the title Add Keyboard Shortcut for Firefox Deasciify Feature Add Keyboard Shortcuts for Deasciify Features in Firefox Mar 15, 2023
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.

1 participant