2

I'm trying to simulate keypress to my games that use direct input.

I googled around and I found out the method SendIput().

It works fine if I try to send keypress to notepad.exe but nothing happend when I tried to games. I checked this site, and I edited my code a little bit but still I don't get any of keypress event from the game.

Can anybody can help me with this?

I used Python but since I imported ctypes module, c/c++ explanation is okay.

grizzthedj
  • 7,131
  • 16
  • 42
  • 62
Sungwon Jeong
  • 1,267
  • 2
  • 15
  • 28
  • May be impossible; DirectInput probably skips most of the OS stuff, leaving you with nothing to interject. What's your purpose? – GManNickG Jan 18 '10 at 08:22
  • I'd like to make some hotkeys(like John Y answered). Actually I'm a C++ programmer and I'm practicing Python thesedays. and I think this(relating games) is the kinda fun way to learn python. – Sungwon Jeong Jan 18 '10 at 08:45
  • I've seen a script that does something like that in Autohotkey but I haven't figured it out completely for combintation of keys http://stackoverflow.com/questions/21557385/sending-combo-key-action-simulating-directinput – Flethuseo Feb 04 '14 at 20:31

1 Answers1

0

It seems you are looking for a Python answer, but personally I would try using AutoHotkey. Its scripting language is on the ugly side, but rather easy to use. There are forum posts (both on Warhammer forums and AutoHotkey forums) to indicate that other Warhammer players are using AutoHotkey.

John Y
  • 14,123
  • 2
  • 48
  • 72
  • Thanks. What I like to do is learning python. write code relating games looks fun to me so I'd like to find way in python..:) – Sungwon Jeong Jan 18 '10 at 08:48