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

Swap real keystroke for a virtual one #141

Open
d-miketa opened this issue Jul 21, 2020 · 2 comments
Open

Swap real keystroke for a virtual one #141

d-miketa opened this issue Jul 21, 2020 · 2 comments

Comments

@d-miketa
Copy link

Having rebound M+h to moving focus west, I realised how much I miss the hide functionality! You can rebind it using System Preferences, but only on an app-by-app basis, eg Safari > Hide Safari. This is impractical so I was wondering if it's possible to bind another keystroke, say S-M-m, and have skhd capture it and send a 'virtual' M+h to the OS? So Mac OS would still think that M+h was pressed and hide the appropriate app, but the physical combination of Cmd and H could be kept for navigation.

@koekeishiya
Copy link
Owner

koekeishiya commented Jul 22, 2020

This is possible, yes. I don't remember if skhd will intercept keypresses that it synthesizes using skhd -k "..". If so this will require some thought to implement properly without breaking the use-case where we can intercept keys that we ourselves post - which is useful for other reasons.

I have lately been rather annoyed by my decision to not use a unix domain socket for integration with external tools. There are also other things I want to support such as being able to differentiate between press, repeat, and release events, and so I am strongly thinking about reworking both the syntax and a fair part of the program structure. If I end up doing so, I will definitely try to keep this in mind.

@d-miketa
Copy link
Author

Sounds good!

In the meantime I realised you could easily remap the hiding functionality using Applescript:

osascript -e "tell application \"Finder\" to set frontProcess to first process whose frontmost is true" -e "tell application \"Finder\" to set visible of frontProcess to false"

Leaving it here in case anyone finds it useful.

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