0

This question is in reference to the following post: Question answered by georgesl

I have copied all of the code that georgesl posted in his answer to the question; however, nothing is happening for me. I am not sure where to start in order to diagnose the problem here. I named the file where I copied all of georgesl's code into "keystud.py" I opened the python console and did the following:

Python 2.7.9
>>> from keystud import *
>>> AltTab()
>>> time.sleep(5); PressKey(0x48)

During the above sleep time of 5, I opened a blank notepad and placed the cursor in it so that the program would hopefully type an "h" in it. I also created a python file with the same code and tried it by running it not using the console to no avail.

Any help would be much appreciated.

Community
  • 1
  • 1
BenjaminL
  • 13
  • 1
  • 6

2 Answers2

0

Just found the answer to my own question. I am running a 64 bit machine and I had to change the following.

changed (line numbers included for easy reference):

Line 4: SendInput = ctypes.windll.user32.SendInput

To the following:

Line 4: SendInput = ctypes.windll.user64.SendInput

Hope this helps someone else.

BenjaminL
  • 13
  • 1
  • 6
  • It is from the post that I referred to: "This question is in reference to the following post:" Look at the first line in my question. Maybe I should have just re-posted the code from the link, sorry for the confusion. – BenjaminL Jan 11 '15 at 03:19
0

Why don't you use:

type('h')

You can use commands like Key.ENTER or Key.TAB to hit the Enter or Tab button etc.

Tenzin
  • 2,415
  • 2
  • 23
  • 36