Commit graph

353 commits

Author SHA1 Message Date
Joshua A. Horton
c3e3fb04d5 fix(web): ensures keyboard does not change underneath OSK keystroke 2022-10-26 09:45:26 +07:00
Joshua A. Horton
d1887a50cd chore(web): drops alignInputs, hideInputs 2022-09-29 08:52:46 +07:00
Joshua A. Horton
7bf29cecfd change(web): disconnects touch alias hooks, adds .inputMode 2022-09-29 08:17:44 +07:00
jahorton
1da9388c97 fix(web): keytip null-guard in shutdown 2022-06-17 09:10:29 +07:00
jahorton
612ffdd06a fix(web): oh yeah, clear the key preview too 2022-06-16 13:38:41 +07:00
jahorton
a4e506d867 fix(web): clears repeating bksp on keyboard reload 2022-06-16 12:17:55 +07:00
Joshua Horton
3cd5ae2b33
chore(web): applies code suggestion
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-06-14 12:52:39 +07:00
jahorton
d23b349106 fix(web): row height layout calcs now consider layer-group padding 2022-06-13 13:30:13 +07:00
jahorton
15ae34a0c8 change(web): increases min dist for a longpress-flick timer shortcut 2022-06-06 08:58:56 +07:00
jahorton
2f1237e352 fix(web): osk shrinkage from rounding 2022-05-25 15:12:25 +07:00
jahorton
0f051edee0 change(web): addresses PR concerns 2022-04-29 10:08:24 -05:00
Joshua A. Horton
d4464b92e5 fix(web): fixes fat-finger distrib when subkey selected 2022-04-26 10:10:21 -05:00
Marc Durdin
2eb10663ba
chore(web): Apply suggestions from code review
Co-authored-by: Joshua Horton <joshua_horton@sil.org>
2022-04-19 06:47:31 +10:00
Marc Durdin
d2d6b4a12d chore: address review comment 2022-04-13 08:18:54 +10:00
Marc Durdin
0ad1d496d3 fix(android): key tip sticky with multitap
Fixes #6489.

The issue arose in multitap scenarios, where the tip display state
became desynchronised with the actual display state as maintained in
the Android code.

The fix I applied was to reduce some of the state checks into the js
wrapper android-host.js. This is not ideal. The state machine for key
tip display is scattered across four functions in three files:

* visualKeyboard.ts: VisualKeyboard.highlightKey
* visualKeyboard.ts: VisualKeyboard.showKeyTip
* embedded/keytip.ts: KeyTip.show
* android-host.js: oskShowKeyPreview / oskClearKeyPreview

I have moved the actual re-creation check for the tip to the lowest
level functions -- those in android-host.js. But a more detailed look at
the state machine and a refactoring would certainly be worthwhile.
2022-04-07 15:27:41 +10:00
Darcy Wong
19f1d4f5a7 chore(android): Merge remote-tracking branch 'origin/beta' into fix/android/subkey-move 2022-03-23 13:05:25 +07:00
Darcy Wong
70ec9b7096 fix(web): Don't update base key if popups displayed 2022-03-17 10:58:48 +07:00
Marc Durdin
ada527bd80 fix(web): bounding rect offset was incorrect
When embedding the On Screen Keyboard into a page, the calculation for
the bounding rectangle only took into account the first offsetParent,
which meant it would get the offset incorrect when there were multiple
layers of offsetParents.

Once I changed to using getAbsoluteX / getAbsoluteY, this also corrects
for scroll with window.pageOffsetY, so we can eliminate that special
case for fixed positioning.

This was observable in the Web Developer test window, where interaction
with the bottom row of the keyboard in touch mode was not working
correctly, in 15.0.210-beta.
2022-03-11 04:34:36 +11:00
Marc Durdin
44ddf1e9aa
Merge branch 'master' into feat/web/3620-caps-layer 2022-01-17 12:26:32 +11:00
Marc Durdin
5fbb1c1dfb chore(web): minor cleanup of pending longpress 2021-12-01 09:27:25 +11:00
Marc Durdin
62796e3489 feat(web): Caps Layer and double-tap gesture
Fixes #3620.

Implements the Caps Lock layer support and the double-tap gesture on the
shift key to access it.

The double-tap gesture has been implemented with a view to extension to
support other multi-tap gestures in the future. However, for now, it is
limited to supporting the Shift key, if and only if the keyboard
includes a Caps layer.

The reason for this v15 limitation is that multi-tap on regular keys
would involve either rewinding the previous keystroke (the first tap),
or forcing keyboard developers to consider 'rota' style rules in their
keyboards to support the multi-tap gestures, as we need to make sure
that the first tap is accepted and processed for immediate feedback.
This needs more design, to avoid unnecessary complexity in the keyboards
and/or the rewinding of the keystroke (even though that is conceptually
supported in Keyman Engine for Web already). Basically, we don't want to
constrain the way that a keyboard author may use the multi-tap gesture
by hard-coding the rewind, but neither do we want to make all multi-tap
gestures needlessly complex to author.

The shift key (and other modifiers, potentially in future) needs special
support for multi-tap as the key that is being tapped changes with the
layer change. This is currently managed through recognising `K_SHIFT` in
the key id.

I have tried to follow the `PendingGesture` pattern for multi-tap, and
the gesture itself supports a series of taps, not just a double-tap. The
maximum time to complete the tap series is 125msec * number-of-taps, so
for a double-tap is 250msec.

The changes to support a Caps Lock layer itself were minimal; just
adding the `text.KeyboardProcessor.getStateFromLayer` function and
calling it during `KeyEvent` construction. The remaining changes relate
to the multi-tap gesture.

Minor changes:
* I moved `constructNullKeyEvent` to `KeyEvent` in order to make it
  more accessible to other classes.
* The multi-tap gesture does not have a promise to complete, so that is
  now an optional member of the `PendingGesture` interface.
2021-12-01 08:59:43 +11:00
Marc Durdin
e98930dedb
Merge branch 'master' into fix/web/5779-font-scaling-in-osk 2021-11-29 09:12:15 +11:00
Marc Durdin
10a41c43cc fix(web): clear longpress timeout if user does a flick up
Fixes #5950.

If a user starts a longpress gesture and then flicks up, that
immediately brings up the longpress menu, and the timeout for display of
the menu should be cancelled -- otherwise the end result is a key that
stays 'stuck' on.
2021-11-19 15:43:27 +11:00
Marc Durdin
9da4ffa77a fix(web): font size was not consistently set
Fixes #5779.
Fixes #5731 (I believe mitigation is sufficient to close this issue).

A variety of interrelated font and font size display issues resolved:
1. KVK font was not applied early enough for size calculations, which
   meant that we were calculating font scaling per key based on a
   default font when transforming from the KVK data for desktop devices
   (defaultLayout.ts)
2. Font scaling for non-default layers was calculated when elements were
   not visible and had no size information, giving incorrect values. To
   resolve this, font scaling is now calculated when a layer is made
   visible, which had performance impacts; resolved by reducing
   unnecessary `layer.refreshLayout()` calls; see performance point 1
   below (oskView.ts:layerChangeHandler())
3. `getViewportScale()` would return an incorrect scaled value when
   emulating touch devices on a desktop browser (kmwutils.ts)
4. After switching keyboards, the device-specific scaling factor was not
   maintained (oskView.ts:refreshLayout())

Related performance improvements:
1. Multiple calls to `layer.refreshLayout()` in `refreshLayout()` have
   been eliminated, and only the currently visible layer is now
   refreshed. This dramatically reduces the number of calls to
   `getIdealFontSize()` which was the primary concern of #5731.
   (visualKeyboards.ts)
2. Unnecessary use of `innerHTML` replaced with `innerText`
   (oskBaseKey.ts)

Minor Keyman Developer performance improvement:
1. The web debugger no longer recalculates the OSK twice (test.js)
2021-11-15 10:08:18 +11:00
Marc Durdin
0cf4a3c512
Merge pull request #5723 from keymanapp/feat/developer/touch-layout-testing
feat(developer): touch layout testing 🎩
2021-10-05 17:40:26 +11:00
Joshua Horton
c008d16654
Merge pull request #5739 from keymanapp/feat/web/mouse-based-banner
feat(web): enables mouse interactivity for the predictive banner 🧵
2021-09-23 10:57:13 +07:00
jahorton
31ac1b7c1b chore(web): replaces literals with constants 2021-09-23 09:27:09 +07:00
jahorton
e87a277be8 refactor(web): first pass generalization for inputEventEngine 2021-09-22 12:37:31 +07:00
Darcy Wong
6240d305b4 fix(web): Check keyboard before marking layout calibrated 2021-09-22 11:02:53 +10:00
jahorton
48fe02023c fix(web): fixes unit test issue (event's 'buttons' property) 2021-09-20 14:39:27 +07:00
jahorton
49e0f2fc68 fix(web): partial fix for %-scaled OSK dimensions 2021-09-02 13:30:26 +07:00
jahorton
632642b6c2 feat(web): functional touch-subkeys on desktop 2021-09-02 12:30:37 +07:00
jahorton
6b248075d6 feat(web): partially-functional inlined OSK! 2021-09-01 15:31:01 +07:00
jahorton
707a7ec745 refactor(web): nixes refit() method 2021-09-01 09:44:36 +07:00
jahorton
e8afd71491 refactor(web): _Show -> present(), presentAtPosition() 2021-09-01 09:44:34 +07:00
jahorton
f070df079d refactor(web): osk._Hide -> osk.startHide 2021-09-01 09:44:34 +07:00
jahorton
6971f09c4d refactor(web): activeElement, lastActiveElement as properties 2021-09-01 09:44:01 +07:00
jahorton
1587887acc fix(web): null check, hidden keyboard on first load 2021-08-23 16:13:18 +07:00
jahorton
8d8291609d chore(web): Merge branch 'refactor/web/vkbd-touch-events' into refactor/web/vkbd-mouse-events 2021-08-19 09:30:26 +07:00
jahorton
e05a23d0be refactor(web): splits detectWithinBounds as requested in review 2021-08-19 09:28:00 +07:00
jahorton
85167994ee fix(web): unit-test issue, TouchEvent compat for desktop 2021-08-17 13:35:39 +07:00
jahorton
b26ea21915 chore(web): Merge branch 'refactor/web/vkbd-touch-events' into refactor/web/vkbd-mouse-events 2021-08-17 10:22:36 +07:00
jahorton
7dd7adb323 chore(web): minor cleanup 2021-08-17 10:21:54 +07:00
jahorton
8656393478 chore(web): Merge branch 'master' into refactor/web/vkbd-touch-events 2021-08-17 08:46:20 +07:00
Joshua Horton
c35c003762
Merge pull request #5462 from keymanapp/refactor/web/vkbd-layout-key-calc-merger
refactor(web): overhaul of OSK key layout calcs + styling, merges desktop & touch logic 📐
2021-08-17 08:36:15 +07:00
Joshua Horton
b5789d2b6a
Merge pull request #5459 from keymanapp/refactor/web/vkbd-layout-calcs
refactor(web): reworks VisualKeyboard layout spec design 📐
2021-08-17 08:36:02 +07:00
Joshua Horton
4ccf48b678
Merge pull request #5451 from keymanapp/refactor/web/vkbd-layout-encapsulation
refactor(web): OSK layout hierarchy encapsulation 📐
2021-08-17 08:35:49 +07:00
Darcy Wong
457311b6cb fix(web): Blank spacebar text when displayName is empty string 2021-08-05 13:09:58 +07:00
jahorton
2d36215e2e chore(web): Merge branch 'refactor/web/vkbd-touch-events' into refactor/web/vkbd-mouse-events 2021-08-04 10:41:57 +07:00
jahorton
f9b038fae8 chore(web): Merge branch 'refactor/web/vkbd-layout-key-calc-merger' into refactor/web/vkbd-touch-events 2021-08-04 10:41:36 +07:00