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

How can I use autopy.key #29

Closed
DTDwind opened this issue Apr 23, 2019 · 3 comments
Closed

How can I use autopy.key #29

DTDwind opened this issue Apr 23, 2019 · 3 comments

Comments

@DTDwind
Copy link

DTDwind commented Apr 23, 2019

Python 3.5
linux mint

When I use "autopy.key.toggle("1",True,autopy.key.MOD_CONTROL)"
I get:
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'autopy.key' has no attribute 'MOD_CONTROL'

Then I try "autopy.key.toggle("a",True,autopy.key.Modifier.CONTROL)"
get:
Traceback (most recent call last):
File "", line 1, in
TypeError

When I use autopy.key.tap(autopy.key.Code.RETURN)
get:
Traceback (most recent call last):
File "", line 1, in
TypeError: Required argument ('modifiers') (pos 2) not found

I don't know how to use this function...
Maybe you can give me some example,thanks!

@DTDwind
Copy link
Author

DTDwind commented Apr 24, 2019

I get it!!!

autopy.key.tap(autopy.key.Code.RETURN,[])
autopy.key.tap('a', [autopy.key.Modifier.CONTROL])

@fl0under
Copy link

I just ran into the same issue, I was expecting autopy.key.tap(autopy.key.Code.RETURN) to work but got

Traceback (most recent call last):
File "", line 1, in
TypeError: Required argument ('modifiers') (pos 2) not found

Thanks DTDwind for posting a working example. I think the docs need some updating.

@msanders
Copy link
Contributor

msanders commented Jun 9, 2019

@DTDwind @fl0under: where did you see this shown in the docs? It looks like it does include List[Modifier] in the signature, but maybe it would be helpful to post an example somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants