In Keyman Developer 10,
NCAPS is available on web as well as Windows. So that may resolve your problem. Make sure you use
store(&version) '10.0' to access 10.0 functionality.
In terms of the question itself:
The compile targets
$keymanweb: can still be useful for controlling cross-platform functionality where there are limitations in the underlying platform. I still use these prefixes for those purposes. However, because they target the compiled file type, there isn’t actually a simple mapping between
platform() and compile targets.
$keymanonly: means the rule will only be compiled into a .kmx file. .kmx files are used only in Keyman Desktop (Windows) and Keyman for macOS.
$keymanweb: means the rule will only be compiled into a .js file. .js files are used in KeymanWeb (all platforms), Keyman for iOS and Keyman for Android.
platform('hardware') targets any physical keyboard, including an external keyboard on an Android or iOS device. You’d need to include two rules to map to
Similarly, to match
$keymanweb:, you need to target:
Now, this is still not a completely 100% compatible mapping, because the
$keyman* compile targets will allow a keyboard to compile when there is a compile-level feature unsupported on the opposing platform, e.g.
return on KeymanWeb, .i.e. the following will compile:
$keymanonly: + 'a' > 'boo' return
But, this wouldn’t, because the code is not excluded from the web platform:
platform('windows native') + 'a' > 'boo' return'
The ideal is that we never have to use
$keyman*, and the reality is that we use a mixture of these language features to get us past both current Keyman cross-platform limitations (which we’ll continue to rectify in future versions), and the more complicated multi-platform differences which usually relate to usage more than technology.