spiegel-keyman/web/docs/engine/reference/core/enableControl.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.3 KiB

title
enableControl

Summary

Enables KeymanWeb input handling for the specified control.

Syntax

keyman.enableControl(Pelem)

Parameters

Pelem
Type: Element
Element to become KeymanWeb-enabled.

Return Value

undefined

Description

There are two steps involved in enabling input handling with KeymanWeb for any given control: attachment and enablement. The attachment process validates a control's compatibility with KeymanWeb and establishes special metadata within the system. This data is released if the control is ever detached. The control will not receive special input handling unless the control is enabled within KeymanWeb.

This function is used to explicitly enable KeymanWeb input handling for a previously-attached control, removing the class 'kmw-disabled' property from the element as necessary. It will not, however, attach KeymanWeb to the control.

If 'kmw-disabled' is removed from the control via other means, enableControl() will be called upon it automatically and non-recursively.

If called on an element in an unattached state, the 'kmw-disabled' tag will be removed from the element.

See also