koekeishiya / skhd

Simple hotkey daemon for macOS
MIT License
6.29k stars 209 forks source link

implement key and modifier alias #288

Closed Miigon closed 1 year ago

Miigon commented 1 year ago

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:

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

Miigon commented 1 year ago

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!

tigger04 commented 1 year ago

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

Miigon commented 1 year ago

@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 commented 1 year ago

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.