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

Text() cannot print combined Unicode characters with hardware keyboard method on Windows #392

Open
comodoro opened this issue Jan 27, 2025 · 1 comment

Comments

@comodoro
Copy link
Contributor

If I invoke the Text action with combined characters (like ď, ć) and I use a keyboard layout that supports them, I get an error and no output.

For example, on the Czech keyboard, common letters ď, ť, ň can only be created by pressing the combining caret character (shift+= on the english keyboard) followed by the particular base letter.
Text('ď').executre() gives the error

Execution failed: Keyboard interface cannot type this character: 'ď'

while Text('ěščřžýáíé').executre() executes without problems.

This can be avoided by setting unicode_keyboard = True in settings.cfg in .dragonfly-speech In user directory, but I wouldn't be comfortable modifying user settings just for my program and have not found a mechanism for setting this when importing dragonfly; does it exist? Still it would be nice to have the option to use scan codes as some applications seem not to be able to handle unicode.

@comodoro
Copy link
Contributor Author

For the current master (not the pypi version) I'm able to do

        if os.name == 'nt':
            dragonfly.actions.keyboard._win32.Win32Keyboard.unicode_keyboard = True

But this is a hack.

I'm biased and this is a matter for discussion, but I think respecting modifier keys in Text does not outweigh these problems and therefore that the direct text method (unicode_keyboard = True) should be the default. Even for English; after all, even the English type foreign names.

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

1 participant