Fixes#5831.
Cherry-pick of #5915.
iOS 15 has a significant crashing bug whereby use of a canvas element
completely crashes the browser in some contexts. In particular, we have
observed this when using a WKWebView in a keyboard extension without
'Allow Full Access' switched on.
Keyman uses canvas element to draw a nice looking key preview (key tip)
on iPhones. This is a critical issue for Keyman for iPhone. Keyman for
iPad is not affected because the iPad version does not use key previews.
The resolution here is to remove use of the canvas drawing for key tips
and use a simplified pure HTML/CSS shape. I have not conditioned this
fix on platform; I have currently opted to apply this to all platforms.
This issue will be reported to Apple for resolution. The issue applies
so far to iOS 15.0, 15.1.
Cherry-pick of #5365.
Relates to #949.
Mirror of #5349 (Android), for iOS.
* Adds setSpacebarText() API to Keyman Engine for iOS
* Adds displayName API to Keyman Engine for iOS
* Sets default spacebar text to keyboard name for FirstVoices Keyboards
* Does not add preference UI
Relates to #949.
* Adds optional `displayName` property to keyboard stubs: if present,
this will override the name on the spacebar.
* Adds optional `spacebarText` member to `keyman.options`. This defaults
to `SpacebarText.LANGUAGE_KEYBOARD`, and can be one of:
```
SpacebarText.LANGUAGE
SpacebarText.KEYBOARD
SpacebarText.LANGUAGE_KEYBOARD
SpacebarText.BLANK
```
* Sets the display pattern for LANGUAGE_KEYBOARD to be
"language - keyboard" instead of "language (keyboard)", which
reduces the number of parentheses visible on the spacebar.
Fixes#4948.
This resets `keyman.osk.dfltX` and `keyman.osk.dfltY` in the
`restorePosition()` function, except when the user clicks the pin (or
`true` passed in for `keepDefaultPosition` parameter). It also moves the
grungy `window.event` hack out of the function and into a private
handler specifically for the pin div `onclick`.
I didn't want to reset `dfltX` and `dfltY` when the user clicks on the
pin, because that is a change in behaviour.
This makes the `osk.restorePosition()` function public and makes it work
even if the OSK is not presently visible. Also DRY out the repeated
implementation.