Code Keyboard Options
Default KeyboardOptions tuned for source-code input.
BasicTextField's built-in default (KeyboardOptions.Default) leaves autocorrect and autocapitalization enabled, which mangles identifiers ("fun" -> "Fun", "println" -> "printing") and is wrong for code. The editor opts callers into code-friendly behavior out of the box:
KeyboardCapitalization.None - no automatic capitalization at sentence boundaries.
autoCorrectEnabled = false- the IME does not rewrite identifiers or symbols.KeyboardType.Ascii - hints the soft keyboard to a programmer-friendly layout.
Override at the call site if you need a different keyboard type (e.g. a search input that should still use the language-default IME):
SyntaxHighlightedTextEditor(
value = editorValue,
onValueChange = { editorValue = it },
language = "sql",
keyboardOptions = SyntaxHighlightedTextEditorDefaults.CodeKeyboardOptions.copy(
imeAction = ImeAction.Search,
),
)Content copied to clipboard