keymanapp / keymanapp/keyman

feat(developer): add newLayer() and oldLayer() statements to Keyman Keyboard Language

Open
#13,790 0 comments 0 reactions 1 assignee Claimed by @markcsinclair View on GitHub
developer/ developer/compilers/ feat m:kmn
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

There are currently two shorthand forms of `if()` statements, namely `platform()` and `baselayout()`, for checking the value of system stores in the input section of rules:

- `platform("platformConstraint")` is equivalent to` if(&platform = "platformConstraint")`
- `baselayout(layoutName)` is equivalent to `if(&baselayout = layoutName)`

Two further possibilities are two new shorthand forms for the `&newLayer` and `&oldLayer` system stores used in touch keyboards:

- `newLayer('shift')` is equivalent to` if(&newLayer = 'shift')` (see [docs](https://help.keyman.com/developer/language/reference/newlayer))
- `oldLayer('shift')` is equivalent to` if(&oldLayer = 'shift')` (see [docs](https://help.keyman.com/developer/language/reference/oldlayer))

This change could be limited to thenext generation KMN compiler, or could be backported as well.

### Keyman apps

- [ ] Keyman for Android
- [ ] Keyman for iPhone and iPad
- [ ] Keyman for Linux
- [ ] Keyman for macOS
- [ ] Keyman for Windows
- [x] Keyman Developer
- [ ] KeymanWeb
- [ ] Other - give details at bottom of form

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.