Support {MODE=VIRTUAL} on macOS#13402
Open
allenbenz wants to merge 1 commit into
Open
Conversation
ae36208 to
663c142
Compare
11d972b to
941a812
Compare
941a812 to
c96be68
Compare
c96be68 to
53b5345
Compare
Author
|
Fixed the formatting for the test file and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for typing through Screen Sharing (and presumably VNC and similar keyboard passthrough windows) #8433
It works similarly to the windows approach except VkKeyScanExW doesn't exist on OSX. (as far as I can tell) and so we have to enumerate through all the keycodes * modifiers to find the keyboard event to character mapping. This could be more efficient with caching it but it was fast enough as is so I thought it wasn't worth the complexity of caching the mapping. This still uses the
else if (mode == Mode::VIRTUAL)branch to gate everything so these changes shouldn't impact regular use.There are a couple limitations to this approach:
I didn't see a way to avoid the limitations when the keypresses are being forwarded to the remote.
An alternative approach would be to always do the key to text mapping lookup, this would let the remote typing to work in a lot of situations without needing {MODE=VIRTUAL}, but that doesn't allow for error messages when the mapping fails and I didn't want to make this kind of change on the main autotype path, if you want that change I can do that but it'll swallow errors.
On that note, I made {MODE=VIRTUAL} fail with an error if the key to text mapping failed, the error has the same text as a similar failure in
AutoTypeXCB.cpp. I didn't wire up the translations as I thought that might make the PR harder to read. Do you want me to add the translations or maybe do something else?Generative AI was used extensively. I am not deeply familiar with either qt or cocoa.
Testing strategy
Ran autotype from an osx laptop to a osx remote via Screen Sharing
Ran autotype from an osx laptop to the local console window
Type of change