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

Simulate a held-down key #418

Open
musjj opened this issue Feb 17, 2024 · 2 comments
Open

Simulate a held-down key #418

musjj opened this issue Feb 17, 2024 · 2 comments

Comments

@musjj
Copy link

musjj commented Feb 17, 2024

KEY_XXX:
  held: [KEY_YYY]
  alone: [KEY_ZZZ]

Currently it's not possible to hold down KEY_ZZZ using KEY_XXX.

In dual-function-keys, there's an option that makes this possible. So when you double-tap KEY_XXX and hold it, it will act as if KEY_ZZZ is being held-down.

Here's an explanation snipped from the readme:

Tap then press again with DOUBLE_TAP_MILLIS (default 150ms) to hold DE.

                             <-------150ms------->
                <---------200ms--------->
keyboard:       LS↓         LS↑             LS↓               LS↑
computer sees:  LS↓         LS↑ DE↓ DE↑     DE↓ ..(repeats).. DE↑

You can continue double tapping so long as it is within the DOUBLE_TAP_MILLIS window.

@k0kubun
Copy link
Contributor

k0kubun commented Feb 19, 2024

when you double-tap KEY_XXX and hold it, it will act as if KEY_ZZZ is being held-down.

Interesting. I would accept a pull request to add such a feature.

Out of curiosity, what do you use the feature for? It's not about keys X, Y, and Z, right?

@musjj
Copy link
Author

musjj commented Feb 19, 2024

I was using it for my Enter mapping:

modmap:
  - remap:
      Enter:
        alone:
          - Enter
        held:
          - Alt_L

Currently, it's not possible to hold down Enter this way. It's not a super big deal, but I'll consider making a PR.

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

No branches or pull requests

2 participants