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

implement key and modifier alias #288

Closed
wants to merge 1 commit into from
Closed

Conversation

Miigon
Copy link

@Miigon Miigon commented Jul 7, 2023

Fixes #174 #6 #280 #226 #194

looks like this:

.alias $hyper cmd + alt + ctrl
.alias $capslock 0x39
.alias $exclamation_mark shift - 1
.alias $terminal_key $hyper + shift - t

# alias as modifier
$hyper - t : open -a Terminal.app

# alias as key
ctrl - $capslock : open -a Notes.app

# alias as mod-key
$hyper - $exclamation_mark : open -a "System Preferences.app"

# alias within alias
$terminal_key : open -a Terminal.app

Simplifying keymaps with eg. hyper keys. Easier to manage configuration.

This PR also:

  • fixed some memory leaks
  • reduced code duplication (parse_hotkey and parse_keypress.)
  • made skhd -k exit with -1 when failed to parse.
  • made skhd --verbose -k respect --verbose (do not close stdout/stderr when in verbose)

This new feature technically deprecates some keycode literals like meh and hyper, however they're still kept for backward compatibility.

@Miigon
Copy link
Author

Miigon commented Jul 8, 2023

After some looking-around, it seems like this repo is not actively accepting changes and PRs.

I've decided to close this PR and create a new fork to experiment with some more new feature ideas (which might break compatibility, that's why I'm forking.)

Some more highly requested features here might also be "stolen" and implemented on that fork, I hope you wouldn't mind that.

I see the new fork as a more evolving version of skhd, with new (incompatible) config syntaxes & semantics and more features. And the original version of skhd can keep being the more stable and compatible alternative for users who don't want to switch and rewrite their config.

This way, we can take away the heavy lifting of supporting skhd and adding new features from you, without breaking anything for old users.

Thanks for your great work on skhd!

@Miigon Miigon closed this Jul 8, 2023
@tigger04
Copy link

tigger04 commented Jul 9, 2023

I am extremely interested in this. Can you link to the fork? Thank you for your work on this @Miigon :)

@Miigon
Copy link
Author

Miigon commented Jul 17, 2023

@tigger04

Update:
this is the fork: https://github.com/Miigon/mkhd

Redesigned a large portion of the parsing procedures and added new features (aliases, layers, keydown/keyup binding, builtin key synthesizing with non-recursive support, etc)

Some features are not yet finalized and many are yet to come. the syntax and semantics are not final either. The only document right now is an example configuration. Take a look and let me know what you think.

The short-term plan is to add highly requested features from skhd issues, then finalize the syntaxes and documentation before releasing the first version.

@koekeishiya
Copy link
Owner

I don't mind what you are doing, but I personally do not think this codebase is worth iterating on. It is better to start from scratch, and if you need to know how some specific macOS things work, look at how it was done here for inspiration as the documentation for said APIs are rather lackluster.

erics118 added a commit to erics118/skhd that referenced this pull request Sep 5, 2023
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.

Cutom key definitions / add rhyper
3 participants