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

macOS: Add fallback to ASCII-capable keyboard layout for handling non-standard input sources #310

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

pentamassiv
Copy link
Collaborator

Added an additional fallback in create_string_for_key() to handle cases where TISGetInputSourceProperty returns NULL after switching to the default keyboard layout via TISCopyCurrentKeyboardLayoutInputSource().

This fallback calls TISCopyCurrentASCIICapableKeyboardLayoutInputSource() to ensure that an ASCII-capable layout is used when the system's current layout does not provide valid Unicode key layout data. This increases robustness when dealing with non-standard or custom keyboard layouts, preventing potential failures during input simulation.

…-standard input sources

Added an additional fallback in create_string_for_key() to handle cases where TISGetInputSourceProperty returns NULL after switching to the default keyboard layout via TISCopyCurrentKeyboardLayoutInputSource().

This fallback calls TISCopyCurrentASCIICapableKeyboardLayoutInputSource() to ensure that an ASCII-capable layout is used when the system's current layout does not provide valid Unicode key layout data. This increases robustness when dealing with non-standard or custom keyboard layouts, preventing potential failures during input simulation.
@pentamassiv pentamassiv merged commit 20534bc into enigo-rs:main Aug 28, 2024
49 of 69 checks passed
@pentamassiv pentamassiv deleted the currentKeyboardLayoutASCII branch August 28, 2024 12:30
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.

1 participant