Skip to content

[Feature] Alias for combinations (#224)#1723

Open
lheiskan wants to merge 1 commit intonikitabobko:mainfrom
lheiskan:hyper
Open

[Feature] Alias for combinations (#224)#1723
lheiskan wants to merge 1 commit intonikitabobko:mainfrom
lheiskan:hyper

Conversation

@lheiskan
Copy link

@lheiskan lheiskan commented Sep 25, 2025

Extends [key-mapping.key-notation-to-key-code] to support defining aliases for modifier combinations (e.g., hyper key).

Example config:

[key-mapping.key-notation-to-key-code]
hyper = 'ctrl-alt-shift-cmd'

[mode.main.binding]
hyper-c = 'workspace c'

Mixing modifiers and keys in a single alias is not supported. Invalid combinations are checked and result in configuration error messages.

Change introduces KeyOrModifier enum to represent either single keys or modifier combinations.

Implements: #224
Related: #389
Related: #1223

PR checklist

  • Explain your changes in the relevant commit messages rather than in the PR description. The PR description must not contain more information than the commit messages (except for images and other media).
  • Each commit must explain what/why/how in its description. https://cbea.ms/git-commit/
  • Don't forget to link the appropriate issues/discussions in commit messages (if applicable).
  • Each commit must be an atomic change (a PR may contain several commits). Don't introduce new functional changes together with refactorings in the same commit.
  • The GitHub Actions CI must pass (you can fix failures after submitting a PR).

Failure to follow the checklist with no apparent reasons will result in silent PR rejection.

Extends `[key-mapping.key-notation-to-key-code]` to support
defining aliases for modifier combinations (e.g., hyper key).

Example config:
```toml
[key-mapping.key-notation-to-key-code]
hyper = 'ctrl-alt-shift-cmd'

[mode.main.binding]
hyper-c = 'workspace c'
```

Mixing modifiers and keys in a single alias is not supported.
Invalid combinations are checked and result in configuration
error messages.

Change introduces `KeyOrModifier` enum to represent either
single keys or modifier combinations.

Implements: nikitabobko#224
Related: nikitabobko#389
Related: nikitabobko#1223
@nikitabobko nikitabobko force-pushed the main branch 2 times, most recently from f324d2e to 7aff813 Compare November 24, 2025 01:31
@yasinkavakli

This comment was marked as resolved.

@zhenpewu

This comment was marked as resolved.

@nikitabobko
Copy link
Owner

I didn't yet have time to review this PR. But just wanted to mention that this PR has heavy merge conflicts with another PR: #1714

The mentioned PR is more important and will be reviewed/merged first. If the conflicts are trivial, I will resolve them myself. Otherwise, this PR might require more adjustments in the future

@yasinkavakli

This comment was marked as resolved.

@zhenpewu

This comment was marked as resolved.

@lheiskan
Copy link
Author

lheiskan commented Jan 26, 2026

Had a look at adding these changes to PR: #1714 - i can update this pull request once #1714 is merged, if that helps. Cheers!

Davincible added a commit to Davincible/AeroSpace that referenced this pull request Feb 11, 2026
# Conflicts:
#	Sources/AppBundle/config/Mode.swift
#	Sources/AppBundle/config/parseKeyMapping.swift
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.

4 participants