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

Automatically capture cursor and keyboard on window focus #5970

Closed
acheronfail opened this issue Dec 13, 2023 · 1 comment · Fixed by #5974
Closed

Automatically capture cursor and keyboard on window focus #5970

acheronfail opened this issue Dec 13, 2023 · 1 comment · Fixed by #5974
Labels
enhancement New feature or request macOS macOS issues
Milestone

Comments

@acheronfail
Copy link

acheronfail commented Dec 13, 2023

Description of the Feature

I'd like to have an option to automatically capture the cursor and keyboard whenever my VM window is activated (gains focus).

Right now, I have to remember each time to tap the modifier combination, and it's quite frustrating when constantly switching between the host and the VM.

Attempted workarounds

I've tried to script with this applescript/hammerspoon, but since the key combination is modifiers only, these applications can't seem to trigger it.

Suggestions

This could be solved in a few ways:

  1. allow changing the key combination to trigger the capture mode, or at least offer another variant which includes a non-modifier key (this would allow other script apps like hammerspoon, etc to be able to hook into it)
  2. add an option "auto-capture on VM window focus" which will automatically capture the cursor and mouse whenever the window is activated (to 'un-capture' the original key combination could be used)
  3. simply add a menu item which "captures cursor and keyboard" (if there's a menu item, then some apps can read those and trigger them - System Preferences can do this, applescript, etc)
@ylluminate
Copy link

In conjunction with this, it would be nice to have some kind of an open source hook that could be utilized in Linux, FreeBSD and elsewhere to auto-release when moving outside of the VM-guest...

@osy osy added the macOS macOS issues label Feb 26, 2024
@osy osy added this to the Future milestone Feb 26, 2024
@osy osy linked a pull request Feb 26, 2024 that will close this issue
@osy osy closed this as completed in #5974 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request macOS macOS issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants