Does anyone know of a library (preferably java) that can give me neighboring keys given a key input for US_ENGLISH standard keyboard?
E.g. if I input the character ‘d’, I should get the following characters returned: [w,e,r,s,f,x,c,v].
Alternatively a grid manipulation api would work too (so that I can instantiate a grid with a qwerty keyboard layout and use it to find my neighbors).
Note 1: I am using the words ‘character’ and ‘key’ synonymously to refer to characters.
Note 2: I know I can hard-code a method to map the 50-or-so primary keys to their neighbors. I am looking for a better solution.
Thank You.
I agree with BlueNovember but in case you want a more “mathematical” solution check this. First you create a grid of characters and then you return all of them that has a distance smaller than 2 from the key passed… Kinda useless but it’s a nice exercise 🙂