简体   繁体   中英

Simulating key presses in a game using Python

Thank you for reading this.

So eg I start csgo, minecraft, or whatever game. When I'm in game I want to open the chat by pressing the key "y", nevertheless, I've tried using pyautogui, keyboard, win32api and win32con, they only simulate virtual key presses and I guess that's the problem since the games don't accept it as real key presses. Is there any way I could simulate it as actual key presses?

I appreciate any answer: Have a good day :)

I don't think Python is the right tool for this, try looking for key mappers (like KeyMapper), they simulate keypresses better afaik and you can easily bound 'y' to press whatever button opens chat in the game you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM