Jisho

×
B6943fd358ee9103504fb57516cd5643
5 Replies ・ Started by Schiz at 2017-11-26 17:40:05 UTC ・ Last reply by Kimtaro Admin at 2018-02-04 20:15:33 UTC

Keyboard shortcut for search box - super easy to implement

It would be very convenient for me, and probably for other users as well, to have a keyboard shortcut that puts the search text box in focus, so that we don't have to scroll and use the mouse for each subsequent search.

This can be easily implemented by adding the following property to the HTML tag of the search box:
accesskey="1"
Now the box can be easily focused by pressing Alt+1 (Alt+Control+1 in FF).

Documentation of this feature: https://www.w3schools.com/tags/att_global_accesskey.asp

Thanks!

2986330e38386f92fee4774b0c54ed66
Kimtaro Admin at 2017-12-27 00:04:29 UTC

@Schiz Sorry for the late reply. This feature already exists, the access key is the letter of the kind of search that you want to make. Alt+A for All, Alt+K for Kanji, Alt+S for Sentences, Alt+W for Words. This will place the cursor in the search bar and fill in the appropriate tag.

76d238b8d6cfaa8562f8dd925f534a81
SenseiHanzo at 2018-01-02 23:59:20 UTC

I think you mean Alt+Shift+[letter], right?

83653a964d1ebf1dff492aa188412614
jakobd2 at 2018-01-03 06:45:12 UTC

That depends on how the browser you're using is implementing these shortcuts on the OS you're using. For me it is Control + Option + Letter.

2986330e38386f92fee4774b0c54ed66
Kimtaro Admin at 2018-01-30 19:39:40 UTC

I've thought a bit more about this and what I currently have is not fully what @Schiz is asking for. If there is already something in the search bar then pressing the existing access keys will perform the search as well. I need to add an Accesskey that just puts the cursor in the search bar without performing a search.

2986330e38386f92fee4774b0c54ed66
Kimtaro Admin at 2018-02-04 20:15:33 UTC

@Schiz I have implemented your idea, with the small twist that pressing the access key 1 will also clear the search field in addition to moving the cursor to it.

to reply.