# Finds the closest neighboring keys of a given letter on a specific keyboard layout
## pip install surroundingkeys
#### Tested against Windows 10 / Python 3.10 / Anaconda
```python
A utility function to find the closest neighboring keys of a given letter on a specific keyboard layout.
Parameters:
-----------
letter : str
The letter for which to find the neighboring keys.
keyboard : str
The keyboard layout identifier. Should be one of the identifiers shown when you call show_all_keyboards().
Returns:
--------
dict
A dictionary containing the neighboring keys of the input letter on the specified keyboard layout.
The dictionary has the following structure:
{
input_letter: {
'side': [list of letters on the left and right sides],
'top': [list of letters above the input letter],
'bottom': [list of letters below the input letter]
}
}
If no neighboring keys are found or the input letter is not available on the specified keyboard layout,
the corresponding list will be empty.
Example:
--------
from surroundingkeys import get_next_letters, show_all_keyboards
for letter in 'Oi, tudo bem?':
result = get_next_letters(letter=letter, keyboard="kbdbr_1")
print(result)
print(letter)
{'O': {'side': ['I', 'P'], 'top': ['9', '0'], 'bottom': ['K', 'L']}}
O
{'i': {'side': ['u', 'o'], 'top': ['8', '9'], 'bottom': ['j', 'k']}}
i
{',': {'side': ['m', '.'], 'top': ['k', 'l'], 'bottom': []}}
,
{' ': {'side': [], 'top': [], 'bottom': []}}
{'t': {'side': ['r', 'y'], 'top': ['5', '6'], 'bottom': ['f', 'g']}}
t
{'u': {'side': ['y', 'i'], 'top': ['7', '8'], 'bottom': ['h', 'j']}}
u
{'d': {'side': ['s', 'f'], 'top': ['e', 'r'], 'bottom': ['x', 'c']}}
d
{'o': {'side': ['i', 'p'], 'top': ['9', '0'], 'bottom': ['k', 'l']}}
o
{' ': {'side': [], 'top': [], 'bottom': []}}
{'b': {'side': ['v', 'n'], 'top': ['g', 'h'], 'bottom': []}}
b
{'e': {'side': ['w', 'r'], 'top': ['3', '4'], 'bottom': ['s', 'd']}}
e
{'m': {'side': ['n', ','], 'top': ['j', 'k'], 'bottom': []}}
m
{'?': {'side': [], 'top': [], 'bottom': []}}
?
Note:
-----
This function uses a cache (LRU cache) to speed up repeated calls with the same inputs.
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/surroundingkeys",
"name": "surroundingkeys",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "keyboard,neighbor",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8d/b8/6242f1e70160f5da601b2dc8ca178077cf8b530bebe20fb695dada6a5234/surroundingkeys-0.10.tar.gz",
"platform": null,
"description": "\r\n# Finds the closest neighboring keys of a given letter on a specific keyboard layout\r\n\r\n## pip install surroundingkeys \r\n\r\n#### Tested against Windows 10 / Python 3.10 / Anaconda \r\n\r\n```python\r\nA utility function to find the closest neighboring keys of a given letter on a specific keyboard layout.\r\n\r\nParameters:\r\n-----------\r\nletter : str\r\n\tThe letter for which to find the neighboring keys.\r\nkeyboard : str\r\n\tThe keyboard layout identifier. Should be one of the identifiers shown when you call show_all_keyboards().\r\n\r\nReturns:\r\n--------\r\ndict\r\n\tA dictionary containing the neighboring keys of the input letter on the specified keyboard layout.\r\n\tThe dictionary has the following structure:\r\n\t{\r\n\t\tinput_letter: {\r\n\t\t\t'side': [list of letters on the left and right sides],\r\n\t\t\t'top': [list of letters above the input letter],\r\n\t\t\t'bottom': [list of letters below the input letter]\r\n\t\t}\r\n\t}\r\n\tIf no neighboring keys are found or the input letter is not available on the specified keyboard layout,\r\n\tthe corresponding list will be empty.\r\n\r\nExample:\r\n--------\r\n\tfrom surroundingkeys import get_next_letters, show_all_keyboards\r\n\tfor letter in 'Oi, tudo bem?':\r\n\t\tresult = get_next_letters(letter=letter, keyboard=\"kbdbr_1\")\r\n\t\tprint(result)\r\n\t\tprint(letter)\r\n\t{'O': {'side': ['I', 'P'], 'top': ['9', '0'], 'bottom': ['K', 'L']}}\r\n\tO\r\n\t{'i': {'side': ['u', 'o'], 'top': ['8', '9'], 'bottom': ['j', 'k']}}\r\n\ti\r\n\t{',': {'side': ['m', '.'], 'top': ['k', 'l'], 'bottom': []}}\r\n\t,\r\n\t{' ': {'side': [], 'top': [], 'bottom': []}}\r\n\r\n\t{'t': {'side': ['r', 'y'], 'top': ['5', '6'], 'bottom': ['f', 'g']}}\r\n\tt\r\n\t{'u': {'side': ['y', 'i'], 'top': ['7', '8'], 'bottom': ['h', 'j']}}\r\n\tu\r\n\t{'d': {'side': ['s', 'f'], 'top': ['e', 'r'], 'bottom': ['x', 'c']}}\r\n\td\r\n\t{'o': {'side': ['i', 'p'], 'top': ['9', '0'], 'bottom': ['k', 'l']}}\r\n\to\r\n\t{' ': {'side': [], 'top': [], 'bottom': []}}\r\n\r\n\t{'b': {'side': ['v', 'n'], 'top': ['g', 'h'], 'bottom': []}}\r\n\tb\r\n\t{'e': {'side': ['w', 'r'], 'top': ['3', '4'], 'bottom': ['s', 'd']}}\r\n\te\r\n\t{'m': {'side': ['n', ','], 'top': ['j', 'k'], 'bottom': []}}\r\n\tm\r\n\t{'?': {'side': [], 'top': [], 'bottom': []}}\r\n\t?\r\n\r\n\r\nNote:\r\n-----\r\nThis function uses a cache (LRU cache) to speed up repeated calls with the same inputs.\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Finds the closest neighboring keys of a given letter on a specific keyboard layout.",
"version": "0.10",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/surroundingkeys"
},
"split_keywords": [
"keyboard",
"neighbor"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7331a45b838522d2215cd8c481b32535f9be22dfbb5d32f050de183c0dc2a71a",
"md5": "d0b804ce9daf2ee9069c9bf6617cc6ea",
"sha256": "f0f74669074ce28ce4164681b18947aba94d16a2229cc26466efbf0f85470389"
},
"downloads": -1,
"filename": "surroundingkeys-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d0b804ce9daf2ee9069c9bf6617cc6ea",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 381353,
"upload_time": "2023-07-31T23:40:21",
"upload_time_iso_8601": "2023-07-31T23:40:21.413241Z",
"url": "https://files.pythonhosted.org/packages/73/31/a45b838522d2215cd8c481b32535f9be22dfbb5d32f050de183c0dc2a71a/surroundingkeys-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8db86242f1e70160f5da601b2dc8ca178077cf8b530bebe20fb695dada6a5234",
"md5": "d2b623f5cadede5f2e5725cdc3570194",
"sha256": "6de72bfd273fd077acb7da212e8628f17b096ae482d6dcdc253c779c3c986fab"
},
"downloads": -1,
"filename": "surroundingkeys-0.10.tar.gz",
"has_sig": false,
"md5_digest": "d2b623f5cadede5f2e5725cdc3570194",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 73346,
"upload_time": "2023-07-31T23:40:23",
"upload_time_iso_8601": "2023-07-31T23:40:23.095218Z",
"url": "https://files.pythonhosted.org/packages/8d/b8/6242f1e70160f5da601b2dc8ca178077cf8b530bebe20fb695dada6a5234/surroundingkeys-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-31 23:40:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "surroundingkeys",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "surroundingkeys"
}