Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 19.0Version 18.0 (current version)Version 17.0

On this page

You are viewing an incomplete pre-release version of this documentation. Click here to open the current version, 18.0.

AnalyzeOskCharacterUse class

Home > @keymanapp/kmc-analyze > AnalyzeOskCharacterUse

AnalyzeOskCharacterUse class

Analyze the characters used in On Screen Keyboard files (.kvks, .keyman-touch-layout) for use with &displayMap.

Signature:

export declare class AnalyzeOskCharacterUse 

Constructors

Constructor Modifiers Description
[(constructor)(callbacks, options)](./kmc-analyze.analyzeoskcharacteruse._constructor_.md) Constructs a new instance of the `AnalyzeOskCharacterUse` class

Methods

Method Modifiers Description
[analyze(file)](./kmc-analyze.analyzeoskcharacteruse.analyze.md) Analyzes a single source file for Unicode character usage. Can parse .kmn, .kvks, .keyman-touch-layout file formats. Can be called multiple times to collect results from more than one file. Use [AnalyzeOskCharacterUse.getStrings()](./kmc-analyze.analyzeoskcharacteruse.getstrings.md) to retrieve results. Note: `analyze()` collects key cap data, so calling this for a .kmn file will retrieve the key caps from the .kvks and .keyman-touch-layout files that it references, rather than key cap data from the .kmn file itself.
[clear()](./kmc-analyze.analyzeoskcharacteruse.clear.md) Clears analysis data collected from previous calls to [AnalyzeOskCharacterUse.analyze()](./kmc-analyze.analyzeoskcharacteruse.analyze.md)
[getStrings(format)](./kmc-analyze.analyzeoskcharacteruse.getstrings.md) Returns the collected results from earlier calls to [AnalyzeOskCharacterUse.analyze()](./kmc-analyze.analyzeoskcharacteruse.analyze.md). This generates a mapping from a key cap (one or more characters) to a PUA code, for use with `&displayMap`. Three output formats are supported: - .txt: tab-separated string format, with three columns: PUA, Key Cap, and plain string. The PUA and Key Cap columns are formatted as Unicode Scalar Values, e.g. U+0061, and the plain string is the original key cap string. - .md: formatted for documentation purposes. Generates a Markdown table (GFM) with PUA, Key Cap, and plain string. The PUA and Key Cap columns are formatted as Unicode Scalar Values, e.g. U+0061, and the plain string is the original key cap string. - .json: returns the final aggregated data as an array of strings, which can be joined to form a JSON blob of an object with a single member, `map`, which is an array of [Osk.StringResult](./kmc-kmn.osk.stringresult.md) objects.