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

Map to key + modifiers #10

Closed
kabouzeid opened this issue Aug 22, 2021 · 4 comments
Closed

Map to key + modifiers #10

kabouzeid opened this issue Aug 22, 2021 · 4 comments

Comments

@kabouzeid
Copy link

Is it possible to map for example caps+w to ctrl+w without remapping caps to ctrl for all keys?

@zsugabubus
Copy link
Owner

zsugabubus commented Aug 23, 2021

Is there any good reason to not to do that? I mean, if you will not press CapsLock with other keys simultaneously, does it count whether it is always Ctrl or not?

(Otherwise it may be possible with struct multi_rule.{down,up}_press but it requires slight coding since it currently makes possible mapping multiple keys only to a single key press.)

@kabouzeid
Copy link
Author

Basically what I want to achieve is the following:

caps+h/j/k/l -> left/down/up/right
caps+b/w -> ctrl+b/w

caps+anything else -> I don't care

@kabouzeid
Copy link
Author

So I got something working now, the first pipe maps caps to right ctrl, and the second pipe overwrite right ctrl + hjkl. It's fine because I'm never using right ctrl anyways.

// interception-caps2rightctrl/tap-rules.h.in

{ .base_key = KEY_CAPSLOCK, .tap_key = KEY_ESC, .repeat_key = KEY_RIGHTCTRL, .hold_key = KEY_RIGHTCTRL, .hold_immediately = 1 },
// interception-rightctrlhjkl2arrows/multi-rules.h.in

{ .keys = { KEY_RIGHTCTRL, KEY_H }, TO_KEY(KEY_LEFT),  DOWN_IFF_ALL_DOWN(2) },
{ .keys = { KEY_RIGHTCTRL, KEY_J }, TO_KEY(KEY_DOWN),  DOWN_IFF_ALL_DOWN(2) },
{ .keys = { KEY_RIGHTCTRL, KEY_K }, TO_KEY(KEY_UP),    DOWN_IFF_ALL_DOWN(2) },
{ .keys = { KEY_RIGHTCTRL, KEY_L }, TO_KEY(KEY_RIGHT), DOWN_IFF_ALL_DOWN(2) },

@zsugabubus
Copy link
Owner

Great!

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