# Telegram Web A keyboard adaptation

Upstream: https://github.com/Ajaxy/telegram-tt

Pinned revision: `28ffcf710b15571e5a2f7bb3bdce3fc90fc8ec80`

Original sources:

- https://github.com/Ajaxy/telegram-tt/blob/28ffcf710b15571e5a2f7bb3bdce3fc90fc8ec80/src/util/captureKeyboardListeners.ts
- https://github.com/Ajaxy/telegram-tt/blob/28ffcf710b15571e5a2f7bb3bdce3fc90fc8ec80/src/hooks/useKeyboardListNavigation.ts
- https://github.com/Ajaxy/telegram-tt/blob/28ffcf710b15571e5a2f7bb3bdce3fc90fc8ec80/LICENSE

License: GPL-3.0-only, retained from the upstream repository. Full text is
distributed in `../telegram-motion/LICENSE`. Upstream files have no individual
copyright header; their authors retain copyright. No Telegram branding or
network protocol implementation is included.

`keyboard.mjs` directly adapts the key-to-handler mapping, stacked capture/release
implementation and bounded list-index navigation. EssayPilot modifications on
2026-10-02 remove TypeScript and Teact hooks, inject the document, isolate each
document's handler stack (shared across search, menus, dialogs and feedback), make cleanup idempotent, snapshot handlers during
dispatch, add the legacy IME guard and Home/End navigation. ArrowUp from no
selection starts at the last result. The application owns aria-activedescendant
and scroll positioning instead of moving DOM focus away from the search input.

This is source reuse, not an assertion of Telegram affiliation or endorsement.
