spiegel-keyman/web/docs/engine/reference/interface/saveFocus.md
Marc Durdin 6c145cb775 refactor(web): move web engine help to app repo
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
2024-10-31 11:00:06 +07:00

1,005 B

title
saveFocus (KSF)

Summary

Save focus: Temporarily saves keyboard processing data for the currently-focused control.

Syntax

keyman.interface.saveFocus()

or

KeymanWeb.KSF() // Shorthand

Parameters

None.

Return Value

undefined

Description

Use this function to temporarily preserve all keyboard processing information during a single change-of-focus event.

This function is designed to allow custom UI elements, custom OSK displays (as for the EuroLatin keyboard), or keyboards with picker-style functionality (such as the Japanese keyboard) to operate without losing the current input state due to loss of focus for the active control.

A good example of when to call this function would be for onmousedown events for visual elements not intended to change the element of focus within KeymanWeb. It is safe for use outside of keyboard code.