Repository navigation
ADFA-4057 | Add Custom Keyboard template bundle - #144
Merged
Merged
Conversation
…emplate Verbatim copy of EmptyActivity from core.cgt, no changes. The next commit turns it into the keyboard template, so its diff shows only what it adds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Kotlin project template for an Android keyboard in a language the shipped keyboards do not cover. Written from scratch; FUTO and HeliBoard informed the UX only (HeliBoard is GPL-3.0 and needs native dictionaries). - KeyboardService: an InputMethodService that commits text, handles one-shot shift and caps lock, symbols, enter actions, sentence auto-capitalisation, and code-point-wise delete. - KeyboardView: custom-drawn keys (the platform KeyboardView is deprecated since API 29) with long-press alternatives, backspace repeat, rollover, TalkBack via ExploreByTouchHelper, sp-sized labels, and room for the navigation bar on edge-to-edge keyboards. - Layouts are JSON in assets/layouts; a key may output several code points. Ships English (QWERTY) and Hindi (Devanagari). - MainActivity: setup screen to enable and choose the keyboard, and try it. The template offers no language choice, so the Kotlin block in app/build.gradle.kts loses its LANGUAGE conditional: the renderer fails on an undeclared variable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jimturner-adfa
requested review from
a team
and removed request for
davidschachterADFA and
hal-eisen-adfa
November 11, 2026 21:40
hal-eisen-adfa
left a comment
Contributor
There was a problem hiding this comment.
A few findings from a code read of the keyboard. They have not been reproduced on a device yet.
…ack, help tag - Hindi symbols row types ASCII digits, with Devanagari in the popup. Number and phone fields open on this layer, and their input filters accept only ASCII 0-9. - Returning from symbols keeps caps lock and re-runs auto-capitalize instead of forcing shift off. - Two shift taps in a row lock caps from any state, including ONCE set by auto-capitalize, so a sentence start no longer needs three taps. - KeyboardView points the press at the matching key after a re-render (or drops it), so backspace draws pressed and release() never acts on a key from the previous layer. Repeat stops if the press is dropped. - TalkBack: long-press alternatives are custom actions (up to eight per key) and the language key has a long-click action for the picker. - tooltipTag is template.custom.keyboard, not Empty Activity's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hal-eisen-adfa
approved these changes
Nov 14, 2026
Contributor
Author
|
Device test of
The TalkBack check performed the actions through |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADFA-4057
Adds
templates/Custom-Keyboard, a template that creates an Android keyboard for a language the shipped keyboards do not cover. Kotlin only. Each language is a JSON layout file; adding one needs no code. Ships English (QWERTY) and Hindi (Devanagari).Review by commit
7b54453- verbatim copy ofEmptyActivityfromcore.cgt. Skim.45a710b- the keyboard:KeyboardService,KeyboardView,KeyboardLayout, the setupMainActivity,method.xml, layouts, gallery files.Design choices
android.inputmethodservice.KeyboardView(deprecated since API 29). View-based, not Compose: Compose in anInputMethodServiceneeds hand-wired lifecycle owners.क्ष= 3 code points) and nukta forms need no code. Rejected: Pebble parameters for key rows (one text field cannot express a layout) and hard-coded Kotlin keys (every language becomes a code change).optional.language, soapp/build.gradle.ktsdrops the${% if LANGUAGE == 'kotlin' %}wrapper: the strict renderer fails on an undeclared variable.Testing
Pixel 6 Pro (arm64, API 37), Code on the Go
C-d-1014-1359:.cgtvia Add-ons Manager; New Project shows the template with no language chooser. Generatedcom.example.my_keyboard, built on device (~50 s), installed, ran.é,ö), symbols, Enter newline in a multi-line field, Search action label and submit in Settings search, नमस्ते, theक्षconjunct key, nukta via long-press (क़= U+0915 U+093C), danda.uiautomator; no live TalkBack session).addons checkpasses.Fixed during device testing: keys behind the navigation bar on edge-to-edge (Android 15+) keyboards; the try-it field hidden by the keyboard; no capital after Enter; long-press hints covering labels at 2x; popup selection not matching the finger until it moved.
Not tested: a live TalkBack session, API levels below 37.
🤖 Generated with Claude Code