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

Add modifiers config option #61

Closed
wants to merge 1 commit into from

Conversation

innovate-invent
Copy link

Resolves #42

I am not actually sure what the use case is here for this. @drjaska would you mind testing this?

@wez
Copy link
Owner

wez commented Jun 8, 2024

I'm also not sure what problem is being solved here, so I'm inclined to sit on this one for now!

@wez wez closed this Jun 9, 2024
@drjaska
Copy link

drjaska commented Jun 11, 2024

@innovate-invent I would reword the newly added text in README.md to

If you want to override the default modifiers (listed below)
you can set a custom set of keys as the modifier keys via the modifiers = [] config option.

from

If you want to override the default modifiers (KEY_LEFTALT, KEY_LEFTCTRL, etc.)
you can list all the modifier keys via the modifiers = [] config option.

but otherwise LGTM. This patch allows users to set custom modifier keys without source code edits which allows for configs suchs as the following to not litter random unremapped keys anymore. Before this patch pressing Capslock, W and S at the same time would let the S presses through but this patch allows the keypresses to be remapped properly.

modifiers = [
  "KEY_CAPSLOCK",
  "KEY_FN",
  "KEY_LEFTALT",
  "KEY_RIGHTALT",
  "KEY_LEFTMETA",
  "KEY_RIGHTMETA",
  "KEY_LEFTCTRL",
  "KEY_RIGHTCTRL",
  "KEY_LEFTSHIFT",
  "KEY_RIGHTSHIFT",
]

[[remap]]
input = ["KEY_CAPSLOCK", "KEY_W"]
output = ["KEY_UP"]

[[remap]]
input = ["KEY_CAPSLOCK", "KEY_A"]
output = ["KEY_LEFT"]

[[remap]]
input = ["KEY_CAPSLOCK", "KEY_S"]
output = ["KEY_DOWN"]

[[remap]]
input = ["KEY_CAPSLOCK", "KEY_D"]
output = ["KEY_RIGHT"]

[[remap]]
input = ["KEY_CAPSLOCK"]
output = ["KEY_F24"]

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

Successfully merging this pull request may close these issues.

Hardcoded modifier keys with no configuration options
3 participants