odebroqueville/contextSearch

Use global extension shortcut page

HifeFish opened this issue · 5 comments

Can the keyboard shortcuts of this addon be integrated into the global extension shortcut page? I found it quite difficult to delete conflicting custom shortcuts as, e.g. pressing backspace just makes "Backspace" the shortcut.

I'm sorry but I don't understand what you mean by "the global extension shortcut page". Concerning the "Backspace" key, I think I can fix that so that it's never offered as a shortcut key for search engines. This way "Backspace" shouldn't appear in the input field for your search engine shortcuts. In the mean time, try selecting the shortcut text with the mouse cursor.

Thanks for the reply.

On the about:addons page, after clicking the gear on the top right, there is an option "manage extension keyboard shortcuts" (or similar). This opens a list of "all" (apparently not all) keyboard shortcuts used by extensions. That is the page I meant. A major advantage is that it detects and highlights conflicts with other add-ons. I am not entirely sure how this works with a variable number of shortcuts like Context Search uses.

Thank you for clarifying. The addons shortcuts page you're referring to contains shortcuts that are defined in the manifest file (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands). Therefore, as you correctly mentioned, these shortcuts cannot contain a variable list or be defined dynamically. Furthermore, I think some users would be confused if part of the search engines' options were defined in the extension's Options page and the shortcuts would be listed in the addons shortcuts page. However, your suggestion is valid and helpful when it comes to letting users specify a shortcut to launch the Icons Grid. So, thank you for your input.

UPDATE: Please verify that you're using the latest version of Context Search (4.7.2), because you should be able to remove text using the 'Delete' or 'Backspace' keys with no issues. You should also be able to move in the input text box using the usual cursor keys.

Backspace and arrow keys now work on version 4.7.2. Thanks for the swift fix!

I agree that it can be confusing to have settings on different pages. Some add-ons, e.g. All Tabs Helper have their own mechanism to set keyboard shortcuts, but they also show up on the Manage Extension Shortcuts page. If you use their own mechanism, it doesn't detect conflicts though. For the Icons Grid shortcut, I think a good compromise could be a button on the settings page sending you to the relevant section of the Manage Extension Shortcuts page, if that is possible.

There is still some strange behaviour with the shortcuts, e.g.:

  • Navigate to the field with Shift+Tab, then press A and the shortcut becomes shift+a.
  • In the shortcut field press context menu key, dismiss context menu, press A and the shortcut becomes "contextmenua". Generally it seems any key combination that triggers some action not controlled by Firefox will appear in the field when you press the next key which will be appended, sometimes nonsensically. Another example is Alt+F, which triggers the file menu. If I then dismiss the menu focus returns to the shortcut box. Then,
    • Pressing Alt makes the shortcut alt+f
    • Pressing F makes the shortcut alt+ff
      Neither of these work, of course, as the shortcut is caught by the desktop environment (in this case Gnome 3).

These are less of a problem, just some oddities I've noticed while playing around.

Unfortunately, I'm only able to test on macOS and I don't think that there's an easy fix that takes into account all browser assigned keyboard shortcuts for all OS's. For example, Firefox on macOS doesn't have an Alt + f keyboard shortcut to open the file menu. However, I tested with Cmd + f which is used to find text. Selecting an input text field, then pressing Cmd + f, then the Escape key, then Alt + f generates the gibberish shortcut: "Cmd + Alt + ff"!!! This is because, for some unknown reason, the keyup event isn't fired when releasing Cmd + f! Crazy stuff! I could remove duplicates, but my recommendation would be to focus exclusively on the shortcut you're typing.

I found another glitch which bothered me more: not being able to mouse click inside the text in an input text field. I will release a bug fix for this in v4.7.3.