Alright, I know this question looks like a duplicate, but I don't think it is. I've read other posts about fake key presses which involve ctypes and SendKey. However, I've tried these and they don't work quite as I want. I don't want something that is similar to an actual keystroke, I want something that does EXACTLY the same thing as a keystroke. I've run some tests with ctypes, and I noticed the key presses don't behave the same as a real keystroke.
For example, if I open up notepad and hold down the A key, I get one A character, and about a second later it starts filling up with As. When I run PressKey() for A, it types a single A and that's it. I still have to run ReleaseKey() for A after it so other programs don't get messed up.
I need some way to do something like realKeyPress('A') and have it behave exactly like I pressed the A key. Also, thanks guys, you're always so fast to respond with nice answers!
So I used ctypes after all. I modified the ctypes code after reading up on another answer similar to this topic. Here's the finished code: