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

Using a mod-tap key in a combo #644

Closed
jdart opened this issue Nov 17, 2022 · 7 comments
Closed

Using a mod-tap key in a combo #644

jdart opened this issue Nov 17, 2022 · 7 comments

Comments

@jdart
Copy link

jdart commented Nov 17, 2022

I would like to have my alpha keys become capitalized on a hold so I have them setup like KC.MT(KC.Q, KC.LSFT(KC.Q)) but the combos module doesn't seem to work with these keypresses.

I tried Chord((KC.Q, KC.W), KC.ESC), and Chord((KC.MT(KC.Q, KC.LSFT(KC.Q)), KC.MT(KC.W, KC.LSFT(KC.W))), KC.ESC),, but I always got the hold key from the mod-tap.

Is there a better way to do auto-shift that cooperates with combos?

@xs5871
Copy link
Collaborator

xs5871 commented Nov 18, 2022

The order of modules matters. For your specific case: does this still happen if you have the combo module before the modtap?
Btw Chord((KC.MT(...)),...) will never work, which has to do with how argumented keys are generated. What you could try instead is:

KCQ = KC.MT(KC.Q, KC.LSFT(KC.Q))
KCW = ...
... Chord((KCQ, KCW), KC.ESC)

In any case, wouldn't make more sense (and be easier to configure), to have a module for auto-caps, instead of declaring more than twenty modtaps?

@jdart
Copy link
Author

jdart commented Nov 18, 2022

@xs5871 Thanks for the suggestions!

I tried moving combos earlier in the modules list and created variables for the auto shift mod taps and that in fact worked, i.e. auto shift and combos both worked! Unfortunately, my one shot mods stopped working.

Do you figure a custom module would be fairly straight forward, or is there already an auto-caps module out there?

@jdart
Copy link
Author

jdart commented Nov 19, 2022

I made an attempt at a module but I don't have python or kmk experience. Could I get some help? https://gist.github.com/jdart/eb3e73740d9b6cc316c5034a879a255a

@jdart
Copy link
Author

jdart commented Nov 19, 2022

Here's another attempt that works but it has to come after the combo, it's a lot simpler but I'm not sure if this is proper kmk or not.

https://gist.github.com/jdart/eb3e73740d9b6cc316c5034a879a255a

@xs5871
Copy link
Collaborator

xs5871 commented Nov 21, 2022

Good effort, but that will actually break a lot of modules, if it's not the last module.
You have to use the resume_process_key mechanism instead of tap_key. Making a new KC.LSFT(...) every time is also not ideal for memory consumption.

@jdart
Copy link
Author

jdart commented Nov 22, 2022

I made another attempt https://gist.github.com/jdart/eb3e73740d9b6cc316c5034a879a255a

I have a feeling I'm not quite understanding the relationship between not returning a key in process_key and how to use resume_process_key.

My code seems to work but I get ReleaseKeyError(ic=16) afterwards.

@xs5871
Copy link
Collaborator

xs5871 commented Nov 24, 2022

process_key is a pipeline handler. Keys get passed through each module and potentially modified, absorbed, or stored for later re-emitting (that's what resume_process_key does).
"Good" examples are the HoldTap and Combos modules.

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