lusakasa / saka-key

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

[Feature request / change ] "numbers" hint characters option #138

Open joefiesta opened 6 years ago

joefiesta commented 6 years ago

I grew up with MouselessBrowsing for hints. That went away. Then Vimperator. That's history. So, SakaKey is a lifesaver. However, I don't understand the implementation of the HINT CHARACTERS. With both Mouselessbrowsing and Vimperator hints were assigned in numerical sequence. That was it. NO CHOICE.

Letters for hints is fine, but, personally, I greatly dislike letters. Maybe most people can't type numbers without looking. So, many letters are okay for them. For me, I would like to see a "numbers" option. I already changed the hint characters to simply "0123456789".

But, I wish after 9 came 10, 11, 12 etc... not 9, 01, 02 ... (The hints sequence 1234567890 is no better.) For one, I have some Autohotkey routines that follow links sequentially. So, with MLB and Vimperator I could select a range, say 8 - 12, and just use a counter in my program to open links 8, 9 , 10 11 and then 12. I have to reinvent numbers to do that with Saka Key.

I would like to propose a "numbers" hint characters option that simply numbers hints, starting at 1 or maybe 0, if you like origin 0 stuff. This would also speed up creating the hints, and I think at this point anything that speeds up SakaKey is beneficial.

(Actually, I think numerical hints are far superior and should be the default, but I didn't design Saka Key. I see on here that many users are coming from VimFx. How did VimFx handle hints?)

lydell commented 6 years ago

Let's say you've got hints labeled from 1 to 10. You then press 1. How would Saka Key know if you intended to activate hint 1 or type the first digit of 10?

How did VimFx handle hints?

That…doesn't really fit in a comment. Luckily, it's all written down:

joefiesta commented 6 years ago

Both MouselessBrowsling (MLB) and Vimperator handled this in 2 ways. In the case of 1 and 10 as hints:

  1. You could hit ENTER after entering just a 1. Hitting 10 would automatically activate hint 10 (unless hints 100+ exist).

  2. There was a builtin timeout. After n microseconds (a user definable value), the entered data was assumed to be the entire hint to be followed. I found the timeout annoying., however, one could disable the timeout functionality.

I had no problem with hitting ENTER. Most people can hit ENTER in their sleep, they do it so often.

The requirement to hit ENTER also assisted in programmatically invoking hints (in my case, using Autohotkey). By requiring ENTER was received, it made it easier to foolproof my code.

joefiesta commented 6 years ago

Another idea. And much simpler. Just avoid the problem with 1 and 10 by starting the numbering of the hints at 10. That would mean changing nothing about the operation of SakaKey. It would work perfectly fine to do what I have suggested. And work fine for pages with up to 90 links. If there were a need to handle more than 90 links on a page (anything's possible!), then the number could just start at 100. SakaKey must be counting the number of links before assigning hints, so again, very little change to the code.

joefiesta commented 6 years ago

another idea. Just add an option to allow specification of "minimum hint length". Hint characters 0123456789 and "minimum hint length" of 2 would do exactly what I have suggested. That the first 10 hints are padded with an extra 0 is annoying but easy to work with in terms of programmatically invoking hints in sequence.