ContextSearch-web-ext
ContextSearch-web-ext copied to clipboard
Hotkey in search engines not working?
FF's One Click Search Engines keywords work but not ContextSearch hotkeys set in its Search Engines. How does it work actually?
On FF 66.0.1
The hotkeys are only really practical for the quick menu. It should work this way:
Set a hotkey in the CS options -> search engines manager ( google = G for instance ) Set the behavior for hotkeys under quick menu -> search actions ( I use Open In Background ) Select some text, open the quick menu and press the hotkey
If you've done that and it's not working, there must be a bug. Let me know.
while trying several things that I didn't know... I also tried search engine hotkeys. I first thought I could create a global hotkey, which would be nice, e.g. select some text and Ctrl-Alt-G for google (only some spontaneous combination). I noticed that it does a similar thing like some other places.
E.g. if I want to press Ctrl-Shift-
The hotkeys under Hotkeys work.
But the Hotkey under Hotkeys / Search Actions does nothing...

I guess something is not working as intended.
FF 86.0b9 on Linux but also Chromium 88.0.4324.182 (Developer Build) built on Debian bullseye/sid, running on Debian bullseye/sid (64-bit)
this hotkey for the context menu also takes only the key I press first:

also checked Vivaldi 3.6.2165.40 (Stable channel) (64-bit) on Linux
I have not thoroughly kept to this convention, but "hotkeys" are intended to mean one button ( no modifier keys ) whereas "shortcuts" can use modifiers.
The Shortcut in Context menu is really only a single key. If you look in any standard UI context menu, some menu items have a letter underlined to indicate you can [key] to expand that menu. This option allows you to set the key you use to expand the menu.
I first thought I could create a global hotkey, which would be nice, e.g. select some text and Ctrl-Alt-G for google
You can, but it would just be g not a combo. I'm looking into adding an option to that menu where users can set whether they want the search engine hotkeys to work as a single keypress or require modifiers. Of course, you may run into all kinds of conflicts with the browser or OS using the same combo.

That "button" doesn't do anything. It's just for looks. I guess I need to remove it, because you're not the first person to make that mistake. I'm still tweaking that page, but that Search Actions section only refers to the hotkeys set for search engines.
I first thought I could create a global hotkey, which would be nice, e.g. select some text and Ctrl-Alt-G for google You can, but it would just be
gnot a combo
I thought of a hotkey without opening the qm. As I said only select some text, press Ctrl-Alt-g. Not important...pressing Ctrl to open the qm (my "hotkey" on selected text), then "g" is also fast. But directly would be the fastest way ever :-) though I probably would quickly run out of available keys...
That "button" doesn't do anything. It's just for looks aha... :-) yes, a button wants to be clicked...
the name Hotkey is especially confusing, if there is a section Hotkeys that mainly defines Shortcuts. May be change that to something like "Hotkeys & Shortcuts".
The naming conventions around this topic are quite interesting. E.g. gtk seems to call underlined letters in menus "mnemonic" and the direct key combinations "accelerator". In Windows the underlined letters seem to be called "access keys". I also remember that key combinations were called "accelerator" in resource files. IMHO the main difference is that a mnemonic/access key is used in a certain mode (like open menu, or open qm) and the other is used more globally. Otherwise it's quite the same...only the scope is different. Mnemonic seems to be good for menus, but doesn't say it's a key (so mnemonic key?). IMHO access key is very similar to accelerator or shortcut or hotkey. Actually, for me, a hotkey is the faster way, pressing it directly executes an action, it's a jump to the target, while a shortcut is only like a chord (? geometry), short-cutting a single bow, not necessarily jumping to the final target directly.
I just found a nice and quite useful functionality with CS:
If I open an image uri in the browser (e.g. via "View Image" in firefox), I thought I cannot open the quickmenu and in fact it is not visible. But if I select the image (haha, not easy, I used Ctrl-A), then use my hotkey (Ctrl) and then the hotkey of the engine (e.g. "I" for Yandex Image Search), it really works !!!
the name Hotkey is especially confusing, if there is a section Hotkeys that mainly defines Shortcuts. May be change that to something like "Hotkeys & Shortcuts".
Yep, that's what I'll do.
I thought of a hotkey without opening the qm
Maybe we're not talking about the same thing, but I can select text and press g to get a search results page to google in a background tab, no qm required. ( i set google to 'g' in the search engines manager ). That checkbox for "Search Engine Hotkeys" lets you use search engine hotkeys without requiring a menu be open.
If I open an image uri in the browser (e.g. via "View Image" in firefox), I thought I cannot open the quickmenu and in fact it is not visible.
Huh... I guess the context scripts & keypress listeners get injected, but there's no DOM to attach the qm. That's unexpected.
But you shouldn't have to press CTRL first if you enabled the search engine hotkeys checkbox. It should work whenever you select text ( or in this case an image ) and press the right key
I can select text and press
g
Oha... it really works :-) actually I didn't believe this, because I thought it would create conflicts. Maybe because I often use CS in edit fields, where it replaces the selection with the pressed letter
But you shouldn't have to press CTRL first
yeah, it works with Ctrl-A, i (i is my hotkey for Yandex Images Search) I'm surprised...
Though I still would like to use any key combination (e.g. to use it in edit fields, or when I have incremental search enabled or similar situations)
Though I still would like to use any key combination (e.g. to use it in edit fields, or when I have incremental search enabled or similar situations)
I'll see about optional modifier keys for use with search engine hotkeys. I feel like it should be a global setting, though for consistency, not on an individual engine basis. You would set all search engine hotkeys to require Alt and Ctrl, for instance. Just have to be careful about triggering some OS or browser shortcuts.
I could attach one or two search engines to special keys and others to a more standard key combination, or I could have a search key on my keyboard and use different modifiers to distinguish between engines... What are the disadvantages if you use a real "shortcut" for the search engine? You can still press single letters like "g" but you are able to do more...?
btw.
The Shortcut in Context menu is really only a single key
so it should be called Hotkey, right?
What are the disadvantages if you use a real "shortcut" for the search engine? You can still press single letters like "g" but you are able to do more...?
None. I'm just being lazy. I think the new shortcuts code is pretty clean so it wouldn't be a big deal to add.
Never know how to use.
Just now, I got it, I have to enable Shortcuts->Search Engine Hotkeys
But the thing is the shortcuts of this add-on are most likely conflicted with shortcuts of vimium/Surfingkeys, which the shortcuts of this add-on will not work at all.
But the thing is the shortcuts of this add-on are most likely conflicted with shortcuts of vimium/Surfingkeys, which the shortcuts of this add-on will not work at all.
Some addons can "capture" keystrokes and not allow them to be seen by other addons. I've seen this before in some other conflicts. I'll try out one of those addons you're using. Just let me know what settings I should use to replicate your issues.
But the thing is the shortcuts of this add-on are most likely conflicted with shortcuts of vimium/Surfingkeys, which the shortcuts of this add-on will not work at all.
Some addons can "capture" keystrokes and not allow them to be seen by other addons. I've seen this before in some other conflicts. I'll try out one of those addons you're using. Just let me know what settings I should use to replicate your issues.
I'm using Surfingkeys, for Surfingkeys, b is to Open a bookmark, g is a prefix for multiple keys, such as gg to Scroll to the top of the page, g0 to Go to the first tab.
In my ContextSearch-web-ext extension,b is to use Bing, g is to use Google for the selected word/string.
You can try to disable Surgingkeys temporarily after selecting word/string and ContextSearch-web-ext window pops up.
I think this one is on the SurfingKeys dev(s). The keystrokes are being captured at the document.documentElement level, and not allowed to propagate. I'm guessing this will block many addons and websites that use those keys. You might post on their git and see what they say.