Relates to #2241. Range expansions are a new language feature that reduce verbosity in Keyman Keyboard Language (.kmn) files by making it possible to collapse sequential ranges with a new `..` operator. It is envisioned that these will be used primarily in stores. Two kinds of expansions are available: character ranges, and virtual key ranges. The syntax is: ``` char '..' char vkey '..' vkey ``` Where the `char` terminator is a single normal character, and the `vkey` terminator is a single virtual key. `outs` is permissible for terminators but no other statement is allowed. Whitespace is per normal Keyman keyboard language syntax. Character ranges will replace the range with the set of characters between the terminators, based on the Unicode value of the terminators. Examples: ``` store(alphabet) 'a' .. 'z' store(alpha_not_bq) 'ac'..'pr'..'z' store(capitals) U+0041 .. U+005A ``` Virtual key ranges work in a similar fashion, but with virtual keys. The starting and terminating virtual key must have the same shift state. This will be most useful for character and numeric virtual keys, as the ranges are based on the numeric value of the virtual key as defined by Windows, not its position on the keyboard. Examples: ``` store(alphakeys) [K_A] .. [K_Z] store(numkeys) [K_0] .. [K_9] ``` Ranges must be positive, that is, you cannot use `'z' .. 'a'`. While this expansion is not expected to be very useful in rules, it is still permitted. `context()` and other offsets are calculated on the expanded form, not the collapsed form. Similarly, `any()`/`index()` offsets are calculated on the expanded form. 'a' .. 'z' > context(3) c this produces 'c', not 'z' Because ranges are expanded at compile time, ranges that are overly long will result in an error, so you cannot use, for example: ``` store(AllUnicode) U+0020 .. U+10FFFF ``` The precise maximum length of a range is dependent on the context where it is used. The changes are entirely compiler-based; no change is made to the .kmx file format or to the Keyman apps. |
||
|---|---|---|
| .github | ||
| android | ||
| common | ||
| developer | ||
| docs | ||
| ios | ||
| linux | ||
| mac | ||
| oem/firstvoices | ||
| resources | ||
| web | ||
| windows/src | ||
| .editorconfig | ||
| .flake8 | ||
| .gitignore | ||
| configure-repo.sh | ||
| crowdin.yml | ||
| HISTORY.md | ||
| lerna.json | ||
| linux.code-workspace | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| TIER.md | ||
| VERSION.md | ||
Keyman makes it possible for you to type in any language on Windows, macOS, Linux, iPhone, iPad, Android tablets and phones, and even instantly in your web browser. Create keyboard layouts with Keyman Developer and share them with the community in the keyboards repository. The Keyman Community have already contributed keyboard layouts for over 1,500 languages!
Keyman is an open source project distributed under the MIT license.
Get Involved
Development Status on status.keyman.com
| Platform | Alpha | Beta | Stable |
|---|---|---|---|
| Windows | |||
| macOS | |||
| Web | |||
| Android | |||
| iOS | |||
| Linux |
Getting Started
Desktop Platforms
Web & Mobile Platforms
Release Types
Each platform maintains multiple types of releases:
- Stable: A released version. On a
stableorstable-<version>branch. - Beta: A version that is nearing full "stable" release. On the
betabranch. - Alpha: Contains the very latest code. These versions are published daily whenever the code changes. On
masterbranch.
License
Copyright (c) 2018-2021 SIL International. All rights reserved.
Licensed under the MIT License.
Keyman for Linux is licensed under the MIT License apart from ibus-kmfl which is licensed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Notes for Contributors
When cloning this repo for local development on a Windows machine, take care not to place it overly deep in your file system.
Some of the paths for compilation can push character lengths around 160 characters long, while certain operations on Windows systems may be limited to paths of 260 characters or less.
For example, git clean on Windows with msys is limited due to dependence on older Windows APIs.
