lusakasa / saka-key

A keyboard interface to the web
https://key.saka.io
MIT License
862 stars 70 forks source link

Feature Request: Use the link's name and numbers for link-hint filtering #32

Open teranex opened 7 years ago

teranex commented 7 years ago

Vimium has an option Use the link's name and numbers for link-hint filtering. When this option is enabled Vimium only uses numbers for link hints, but allows to filter down the possible target links by typing a part of the link-title.

ghost commented 7 years ago

Looks like this is on the todo under Hard. Personally I prefer the way VimFx does it, where you can type lower case letters to filter by link text, and then the hints are labeled by upper case letters. This way you can select links with numbers in them, and one-handed navigation works.

eejdoowad commented 7 years ago

This is actually a feature multiple people have requested. I'll bump it up on the list of priorities.

I'll make the keys configurable so you can choose to use number keys or capital letters. The default profile will use capital letters by default since they're easier to reach and don't make numbered links unusable.

teranex commented 7 years ago

@jennifer25519 oh I never knew that was possible in VimFx. When I switched from Pentadactyl/Vimperator to VimFX I immediately customized it to use numbers for the hints, but using upper case letters for the hints as you describe seems nice as well and even more functional.

AndrewBelt commented 7 years ago

VimFX implements the configuration "switching" in a clever way. By default, VimFX accepts keys "qwertyuiopasdfghjklzxcvbnm" (or something similar), but to change to "filter" mode, you edit the allowed keys to "1234567890". When a key is pressed in hint mode that is not in that list, the typed character is used to filter the hints by text matching. This way, you can expand the keyset to include characters "`1234567890!@#$%^&*()-=_+[]{}|;':",./<>?" if you wish, while allowing letters to "pass through" to text filtering. Looking back on the first case, if you type numbers when your keyset is only letters, it actually applies the typed numbers as a text filter.

This is slightly more difficult to wrap your mind around than a simple numbers/letters toggle switch, but it is likely no more difficult to implement due to the simple "if not in keylist, use as text filter" logic, and it is more expandable.

eejdoowad commented 7 years ago

@AndrewBelt, excellent note. What you describe is the plan.

sharethewisdom commented 7 years ago

I abandoned vimperater a few years ago, and I really miss the fuzzy matching of different hint-tag modes. Some thoughts, in addition to the logic described by @AndrewBelt:

Hints are different from a page search in that you look for some secific elements in the viewport, in order to do something to it: mouseover, focus, click, download, inspect, ... But most useful would be to fuzzy match words from hyperlinks. I find it to be the most intuitive way to navigate. Pages may change, also visually, but the link I look for rarely does.

Different things to hint could be arbitralily configured: images could be filtered by their alt attribute, while elements with role attributes, for example, could be matched either by name, title, or whatever suits the user's preference, the element's secifications or the role.