Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use this a lot, but the problem with this, that still hasn't been fixed after all these years, is if you have 2 or more keyboard layouts, you can't make more than one bookmark pointing to the same URL with different search prefixes.

So if, for example, you wanted to make

> x <search_term>

and

> y <search_term>

both work the same, x and y being letters from 2 different alphabets but mapped to the same keys, you couldn't, without some JavaScript. If you just added those 2 keywords, even if you manually edited or created your bookmarks, one bookmark would override the other and the other would appear empty with no keyword.

The workaround I found was using a bookmark with this code in it (instead of the usual URL):

javascript:(function(){var keywords="%s";var mainURL="https://<URL>/";var searchURL="https://<URL>/<params>-"+keywords;if(keywords==""||keywords=="%"+"s"){window.location=mainURL}else{window.location=searchURL}})();

Where https://<URL>/<params> is something like https://example.org/search/q-.

It's slower and sometimes doesn't work if you type "y" and then the query too fast, especially if you're pasting the query. So sometimes it doesn't work and searches with the browser's default search engine for "y <query>".





I'm guessing the number of people this affects is approximately 1.

The number would be most of the people who use the keyboard shortcuts && who use 2 or more layouts && who don't want to change languages to search for something.

It's just muscle memory for me.

CTRL+T -> x <search_term> -> ENTER

Most often I enter <search_term> with CTRL+V, so the sequence is:

CTRL+T -> x CTRL+V -> ENTER

Nowhere in that sequence is the keyboard layout important (if you don't write anything, but just paste).

Just like CTRL+T works even if you're not writing in a layout where the "T" key is mapped to the letter "T", so should "x" work no matter what it's mapped to.


At least 2.

Being able to put language-specific shortcuts on keys that change with the keyboard layout is damn useful.

Why does software have such powerful modes for Python and JavaScript, but never for French or English?


I think everyone who regularly writes eg both Spanish and English, or Chinese and English etc will be affected. That's a LOT of people. Not all languages rely heavily on accents or special symbols but those do. (For example in Spanish you don't want to mix up 'año' and 'ano' :)

You can make the URLs slightly different, with the same result on most sites, by adding an ampersand:

https://en.wikipedia.org/wiki/Special:Search?search=%s

https://en.wikipedia.org/wiki/Special:Search?&search=%s

Each of those can have a different keyword.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: