autopy icon indicating copy to clipboard operation
autopy copied to clipboard

More keys

Open Jah-On opened this issue 4 years ago • 5 comments

Hi, Thanks for making this super fast module! I did notice a few keys were missing in the API reference such as num keys. Could you please add support for all 101 keys? Thanks!

Jah-On avatar Nov 14 '20 03:11 Jah-On

I second this request, as I am making a tool that plays the game we make at work. I just started programming in Rust, but come from a decent foundation in c++ so I may try implement it myself, and submit a PR. It doesn't look to terribly difficult to add some extra keys.

wvupike2006 avatar Dec 05 '20 23:12 wvupike2006

Thanks dude!

Jah-On avatar Dec 06 '20 15:12 Jah-On

@Jah-On Were you using this for a rust program as well as python, or only on python?

I figured out a solution but if you are in a hurry i figured i could just tell you. If it is python, use pydirectinput for keyboard functions as pyautogui fails if you are having your bot play a game with directx. Autopy is the best solution for image recognition, so use both and only import the function for keys and it should work great.

As for rust, I have a workaround as well as a solution that i would like to integrate into this project, but it may be a few days. I can give you the workaround if you need it for rust, just let me know.

One last bit of advice that i wish i had came to right away, is if you need your program to work on multiple monitors, consistently, use get_color() on unique pixels and then take the max of the 3 rgb values to account for slight variance. return true if pixel colors match to check your screen state and minimize the amount of photos needed.

wvupike2006 avatar Dec 07 '20 03:12 wvupike2006

I need it for python. It looks like pydirectinput is Windows only. I'm using it to make a cross platform remote desktop app, not a game bot ha ha. When do you think you could add the rust code? I would appreciate it if it could be done within 2-3 weeks but would still be grateful if it ended up being longer than that. Thanks!

Jah-On avatar Dec 07 '20 04:12 Jah-On

@wvupike2006

Jah-On avatar Dec 10 '20 21:12 Jah-On