mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 08:25:32 +00:00
Note: build.sh updated to make sure that test:help build action:target doesn't also call test.sh by adding `:_all` meta-target. Note: CI will need a new help-keyman-com.sh build step to deploy web engine help. Fixes: #12347
57 lines
1.2 KiB
Markdown
57 lines
1.2 KiB
Markdown
---
|
|
title: deleteContext (KDC)
|
|
---
|
|
|
|
## Summary
|
|
|
|
Context deletion - removes the specified number of deadkeys and characters from before the caret.
|
|
|
|
## Syntax
|
|
|
|
```c
|
|
keyman.interface.deleteContext(dn, Pelem);
|
|
```
|
|
|
|
or
|
|
|
|
```c
|
|
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`](fullContextMatch). For comparison with [Developer 'rules'](/developer/language/guide/rules) from keyboard source code...
|
|
|
|
```keyman
|
|
store(pair_1) 'uU'
|
|
store(pair_2) 'lL'
|
|
|
|
c Lots of keyboard rules...
|
|
|
|
'nul' dk(nothing) + '.' > nul
|
|
```
|
|
|
|
would have a rule output as follows:
|
|
|
|
```c
|
|
// Context is length four (three characters + one deadkey), so we delete all four.
|
|
keyman.interface.deleteContext(4, element);
|
|
```
|
|
|
|
## See also
|
|
|
|
- [`keyman.interface.fullContextMatch()`](fullContextMatch)
|