Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Make dragonfly "Text" action work with nordic keyboards #67

Open
madsBR opened this issue Mar 7, 2018 · 11 comments
Open

Make dragonfly "Text" action work with nordic keyboards #67

madsBR opened this issue Mar 7, 2018 · 11 comments

Comments

@madsBR
Copy link

madsBR commented Mar 7, 2018

Atm the Text action bugs with all chars which require alt+ctrl on the Keyboard. On a nordic keyboard this includes
@£$€{[]}|

i fixed it by replacing
"elif" by "if" in here
https://github.com/t4ngo/dragonfly/blob/master/dragonfly/actions/keyboard.py
at line 121,122,137,138

but i don't know if it will have bug -consequences later..

@chilimangoes
Copy link

@madsBR Could you tell me the Windows version you're using and the exact name of the language pack or keyboard layout in your language/keyboard settings? I'm working on a port of the Dragonfly actions to C# to enable interacting with admin processes and one of the things I would like to address is better handling of international keyboard layouts. This would be a good test case for me to add.

Also, @t4ngo hasn't been active on github or maintained this project in ages. You may want to check out one of the forks that's being more actively developed:

@Shoggomo
Copy link

Shoggomo commented May 8, 2018

None of these forks worked for me (german keyboard). Monospark's fork doesn't even seem to work for my usecase (I'm using caster ontop of dragonfly). However 8327d75 from Monospark's fork seems to be the language fix and could be implemented in another fork.

Edit and Solution:
Wrong commit. ebc094c did the trick. This enables different keyboard layouts.

@chilimangoes
Copy link

Yep, that was the change set I was referring to. @pimp22 have you tried the above solution to see if it works for your issues?

@reckoner
Copy link

Does this apply to the case where,

Text('σμ').execute()

would work? That is, does it get Text to emit Unicode UTF-8 characters?

@drmfinlay
Copy link

@reckoner No, unfortunately this doesn't work for all UTF-8 characters. Text and Key are dependent on the keyboard layout you use. The changes mentioned just allow some different layouts to work correctly.

@reckoner
Copy link

@Danesprite Thanks! You just saved me a lot of research.

@drmfinlay
Copy link

@reckoner No problem. I think the Windows API does allow for that, but it requires rewriting dragonfly's keyboard interface. One workaround for this is to use the Clipboard class to copy the Unicode strings you want and paste them using Key. E.g.:

from dragonfly import Clipboard, Key
Clipboard.set_system_text(u"σμ")
Key("c-v").execute()

I think you can also use the Paste action.

You need to put # encoding=utf-8 (or similar) on the first line of the source file to make Python 2.7 use that encoding instead.

@Versatilus
Copy link

@reckoner No problem. I think the Windows API does allow for that, but it requires rewriting dragonfly's keyboard interface.

I have a mostly functional implementation of this I've been using for most of 2018. It didn't require rewriting nearly as much as I expected it to. I'm not sure that I've even bothered to push it to GitHub. I'm up for discussing the issues in Gitter when I've finally finished this SimCity binge I've been on.

@drmfinlay
Copy link

Ah okay then, that's good to hear. Sounds good 👍

@reckoner
Copy link

@Danesprite Thanks for the Paste idea. I will look into it. I also look forward to your @Versatilus keyboard implementation.

@caspark
Copy link

caspark commented Dec 31, 2018

For the record, it looks like @Versatilus has merged his Unicode Text action PR into @Danesprite 's fork, so uninstalling original dragonfly then doing something like pip install dragonfly2==0.10 --upgrade might do the trick for you now @reckoner .

Versatilus pushed a commit to Versatilus/dragonfly-old that referenced this issue Nov 23, 2019
Add WSR/SAPI5 retain audio support; tweak documentation & gitignore
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants