Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): Custom layer targets for Shift double-tap #7608

Merged
merged 1 commit into from Nov 3, 2022

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Nov 2, 2022

Applies proposed feature https://community.software.sil.org/t/testing-caps-on-touch/6849/5:

  1. A caps layer must still exist in the keyboard.
  2. If there is at least one multitap subkey defined on the Shift key on the active layer, then the nextlayer property of the first multitap subkey for the Shift key will be used instead of the default caps.
  3. This does not change the behavior of the Shift key otherwise.

For example, the following defines a valid multitap key on Shift on the rightalt layer to switch to a custom extended rightalt-caps layer.

  {
    "id": "K_SHIFT",
    "text": "*Shift*",
    "width": 150,
    "sp": 1,
    "nextlayer": "rightalt-shift",
    "layer": "default",
    "multitap": [
      {
        "text": "",
        "id": "T_new_694",
        "sp": "1",
        "nextlayer": "rightalt-caps"
      }
    ]
  },

This does not implement any other multitap functionality. It just allows the keyboard developer to specify a target layer for a given double-tap.

This change should be forward-compatible with the multitap gesture support.

@keymanapp-test-bot skip

We'll do some testing on this with @MattGyverLee once this hits beta.

Applies proposed feature https://community.software.sil.org/t/testing-caps-on-touch/6849/5:

1. A `caps` layer must still exist in the keyboard.
2. If there is at least one multitap subkey defined on the Shift key on
   the active layer, then the `nextlayer` property of the first multitap
   subkey for the Shift key will be used instead of the default `caps`.
3. This does not change the behavior of the Shift key otherwise.

For example, the following defines a valid multitap key on Shift on the
`rightalt` layer to switch to a custom extended `rightalt-shift-caps`
layer.

This does not implement any other multitap functionality. It just allows
the keyboard developer to specify a target layer for a given double-tap.

```
  {
    "id": "K_SHIFT",
    "text": "*Shift*",
    "width": 150,
    "sp": 1,
    "nextlayer": "rightalt-shift",
    "layer": "default",
    "multitap": [
      {
        "text": "",
        "id": "T_new_694",
        "sp": "1",
        "nextlayer": "rightalt-shift-caps"
      }
    ]
  },
```
@mcdurdin mcdurdin self-assigned this Nov 2, 2022
@mcdurdin mcdurdin added this to the B16S1 milestone Nov 2, 2022
@mcdurdin mcdurdin merged commit 6415a2a into beta Nov 3, 2022
@mcdurdin mcdurdin deleted the feat/web/custom-shift-multitap-layer branch November 3, 2022 04:05
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 16.0.96-beta

@MattGyverLee
Copy link
Contributor

MattGyverLee commented Nov 4, 2022

@mcdurdin I've just tested the Cameroon Azerty on my fork (Master branch of https://github.com/MattGyverLee/keyboards/tree/master/release/sil/sil_cameroon_azerty) on 16.0.96, and it works completely as expected! So far, I have only tested in the debugger and not on native Android/iOS.

Now I just need to decide what version of Keyman should be stable before I release it on keymanapp/keyman
(https://community.software.sil.org/t/testing-caps-on-touch/6849/11)

Note: It's interesting that your pseudocode above uses rightalt-shift-caps, which actually doesn't exist in my mobile keyboard.
"nextlayer": "rightalt-shift-caps"

  • Tapping rightalt > caps > shift on mobile cancels caps and takes you back to rightalt.
    • That case is handled by &CasedKeys on desktop.
  • Tapping rightalt > shift > caps on mobile "upgrades" your shift to a caps and goes to rightalt-caps.

@mcdurdin
Copy link
Member Author

mcdurdin commented Nov 7, 2022

It's interesting that your pseudocode above uses rightalt-shift-caps

That's because my pseudocode is dumb. It should be rightalt-caps ... 😆

And ... fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants