spiegel-keyman/web/docs/engine/reference/interface/deleteContext.md
Marc Durdin 1f82507730 docs(web): deprecate unused and obsolete API endpoints and docs cleanup
Deprecate the following obsolete functions and properties:
* `keyman.helpURL`
* `keyman.util.rgba`
* `keyman.util.toFloat`
* `keyman.util.toNumber`
* `keyman.util.toNzString`

Use correct language for code blocks in Keyman Engine for Web
documentation.

Test-bot: skip
2026-08-12 16:07:22 +02:00

1.2 KiB

title
deleteContext (KDC)

Summary

Context deletion - removes the specified number of deadkeys and characters from before the caret.

Syntax

keyman.interface.deleteContext(dn, Pelem);

or

KeymanWeb.KDC(n, Pelem); // Shorthand

Parameters

dn
Type: number
The number of entries (deadkeys, characters) to be deleted from the current context.
Pelem
Type: Element
The element being operated upon.

Return Value

undefined

Description

This is a core element of keyboard input management within KeymanWeb introduced with version 10. It is utilized to manage the deletion of context in a deadkey-aware manner, in parallel to keyman.interface.fullContextMatch. For comparison with Developer 'rules' from keyboard source code...

store(pair_1) 'uU'
store(pair_2) 'lL'

c Lots of keyboard rules...

'nul' dk(nothing) + '.' > nul

would have a rule output as follows:

// Context is length four (three characters + one deadkey), so we delete all four.
keyman.interface.deleteContext(4, element);

See also