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(supertab): modkey timeout for rotate key press #1080

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lewurm
Copy link

@lewurm lewurm commented Dec 30, 2021

Snippet from documentation diff:

In addition to the keycodes above a modifier (modifier-key) can be configured that is pressed simultaneously with the configured keycodes, and then held until another keycode is send via an encoder action or a timeout (mod-timeout-ms) is reached.

Example for application switching:

sm: supermods {
    compatible = "zmk,behavior-sensor-rotate-key-press";
    label = "encoder supermod";
    #sensor-binding-cells = <2>;
    modifier-key = <LWIN>;
    mod-timeout-ms = <1200>;
};
[...]
sensor-bindings = <&sm TAB LS(TAB)>;

Application switching with rotary encoder

Example for selecting characters in an text editor:

hlm: highlightmods {
    compatible = "zmk,behavior-sensor-rotate-key-press";
    label = "encoder highlighter";
    #sensor-binding-cells = <2>;
    modifier-key = <LSHFT>;
    mod-timeout-ms = <500>;
};
[...]
sensor-bindings = <&hlm RIGHT LEFT>;

Select characters with rotary encoder

@caksoylar
Copy link
Contributor

This seems pretty useful! Related: #997

Regarding documentation, I am curious if we should have a policy about including gifs. In my opinion it might be too distracting (and also cause large size page loads). @zmkfirmware/docs what do you think?

@lewurm
Copy link
Author

lewurm commented Dec 31, 2021

This seems pretty useful! Related: #997

Thanks, I haven't seen this yet. Reading that, it makes more sense to split the idea of this PR into two separate things:

  1. As suggested in Feature request: Automatically held/released mods for certain keycodes for Alt-Tab window switching #997, implement another behavior that has this "mod holder" functionality.
  2. Add a new behavior forsensor-bindings such that not only the &kp behavior can be used, but any arbitrary one. Apart from the suggested "mod holder" behavior I would like to be able to map &rgb_ub to the rotatry encoders (mentioned in RGB Underglow improvements #65 ).

Of course, I don't know how to actually implement those nicely 😉 I'll keep this PR open for visibility, so if someone wants the funcitionality today it can be cherry-picked, but it should probably not be merged as-is.

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

Successfully merging this pull request may close these issues.

2 participants