Skip to content

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