Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send Key press for a game?
#1
I'm just trying to send simple key commands to a video game. I've tried a few different pypi options and pywin32 to send keystrokes. pynput send mouseclicks but not keystrokes. Though all of these will send to something like notepad, keystrokes aren't showing up in game.

Any ideas?
Reply
#2
what game? What is your code for each various library?
Recommended Tutorials:
Reply
#3
The game is EverQuest.
pynput for example. Again, the code works fine everywhere except on top of this game. Even when it's called to the forefront. The pynput mouse movement and clicks work great, not the keys though. I'm not sure if there is a 'lower level' key send option I need to use or what is available.
from pynput.keyboard import Key, Controller

keyboard = Controller()

# Type a lower case A; this will work even if no key on the
# physical keyboard is labelled 'A'
keyboard.press('a')
keyboard.release('a')
Reply
#4
AutoHotKey might be easier to do this with: https://www.autohotkey.com/
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020