Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Bug] if layer has optionalAny, keys should allow optionalAny as well #89

Closed
DrakeEvans opened this issue Jun 19, 2023 · 2 comments
Closed

Comments

@DrakeEvans
Copy link

This code above enforces layers with modifiers do not allow keymaps to have modifiers but does not handle the case when both need to have optional any modifiers

This code produces valid configuration for example and is required to allow common shortcuts like command + left_arrow etc for the remapped keys

layer('semicolon', 'semicolon-down')
    .modifiers({ optional: 'any' })
    .manipulators([
      withModifier({ optional: 'any'})([
        map('l').toAfterKeyUp('right_arrow'),
        withMapper({
          j: 'left_arrow',
          k: 'down_arrow',
          l: 'right_arrow',
          i: 'up_arrow',
        })((k, v) => map(k).to(v as ToKeyCode)),
      ]),
    ]),
@evan-liu
Copy link
Owner

Hi @DrakeEvans , thanks for trying the project out. It is a cool idea to pass optionalAny on the layer to manipulators. I've made it the default behaviour, so you do not need to manually add withModifier('??'):

layer(';', 'arrow-mode')
  .modifiers('??')
  .manipulators({
    j: toKey('←'),
    i: toKey('↑'),
    k: toKey('↓'),
    l: toKey('→'),
  }),

Please update (1.20.0) and give it a try, and let me know if it works for you.

@DrakeEvans
Copy link
Author

I rebased and it looks like its working!! Thank you

Repository owner locked and limited conversation to collaborators Dec 1, 2023
@evan-liu evan-liu converted this issue into discussion #116 Dec 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants