Questions tagged [directinput]

135 questions
16
votes
2 answers

Simulating Keyboard with SendInput API in DirectInput applications

I'm trying to simulate keyboard commands for a custom game controller application. Because I'll need to simulate commands in a DirectInput environment most of the usual methods don't work. I know that using a hook would work 100% but I'm trying to…
Jason
  • 391
  • 1
  • 2
  • 8
16
votes
7 answers

Should I use DirectInput or Windows message loop?

I'm working on a C++ DirectX 2D game and I need keyboard and mouse input. Wikipedia says: Microsoft recommends that new applications make use of the Windows message loop for keyboard and mouse input instead of DirectInput So how should I use it? I…
Adir
  • 1,393
  • 3
  • 17
  • 31
15
votes
1 answer

Translates the XInput calls to DirectInput calls on MAC OS X (Emulate x360 controller from PS3 one)

There are a lot of games in steam working with x360 controllers but not mapped properly with a PS3 DS3 controller... MotionInJoy do it clean with "emulate 360 controller" but it works only on PC. There is another PC-only project : x360ce :…
AugustinR
  • 159
  • 1
  • 4
10
votes
1 answer

Simulate XBox Controller Input with Python

I want my python programm to simulate an XBox controller input. Both analog thumb sticks and the on/off buttons if possible. I found topics about simulating Keyboard input with ctypes in python, for example here: Python simulate keydown Is it…
Herka
  • 527
  • 1
  • 4
  • 14
9
votes
1 answer

Low level mouse hook and DirectX

I'm building an application which needs to filter some mouse clicks system-wide. That is, I need to make the system ignore some mouse button clicks at special occasions. I use low level mouse hook and SetWindowsHookEx to filter out these clicks. It…
Paya
  • 4,906
  • 4
  • 39
  • 66
7
votes
7 answers

DirectInput8 EnumDevices sometimes painfully slow

Sometimes (in about 50% of runs), EnumDevices takes 5-10 seconds to return. Normally it is almost instant. I couldn't find any other reports of this kind of behaviour. When things are this slow, it's ok to profile by watching stdout :)…
Ben Hymers
  • 22,821
  • 15
  • 55
  • 79
6
votes
1 answer

DirectX Game hook

I'm trying to simulate mouse events in a game. The games uses DirectInput so you can't use SendMessage to send mouse events/keyboard events to it, that's basically why I have to hook in to the game. Also I don't want to use SendInput/mouse_events,…
6
votes
1 answer

Using DirectInput to receive signal after plugging in joystick

I have a C++ program that enumerates all the input devices (using direct input) at the start of the program. If the program is started, and then I plug in another controller, this controller won't be recognized until the program is restarted. …
Magn3s1um
  • 2,698
  • 3
  • 18
  • 36
5
votes
3 answers

How to Import Other Namespaces into Visual C#?

Sorry if my question seems a little noobish but I can't find an answer. I would like to use DirectInput for my XNA game. I've read around and it seems this is the best way to get input from a gamepad other than a XBox 360 controller. The first step…
MrSplosion
  • 173
  • 1
  • 3
  • 10
5
votes
1 answer

Why does my DirectInput8 stack overflow?

The overall program is too complex to display here. Basically, just pay attention to the green highlights in my recent git commit. I am very new to DirectInput, so I expect I've made several errors. I have very carefully studied the MSDN…
TheBuzzSaw
  • 8,241
  • 3
  • 34
  • 53
5
votes
1 answer

C# DirectInput SendInput Doesn't affect to game

I need some help about DirectInput, I'll tell what i am trying to do. I want to do my program sends key combinations to a game when i press only one key. Examp.: I'll press "r" and it will pres "1","3","2","4" keys. I found some codes from here. But…
eyups
  • 671
  • 6
  • 12
4
votes
1 answer

Reverse engineering global hot key block

I'm trying to reverse engineer (OllyDbg) an application (game) that disables (captures/intercepts/blocks) all global hot keys while its window (D3D) is active (except Ctrl-Alt-Del). My question is in which ways could such application capture/disable…
Qtax
  • 31,392
  • 7
  • 73
  • 111
4
votes
0 answers

Emulate Xbox 360 controller with mobile

I'm developing an app for symbian phones to emulate an Xbox 360 controller. I have made all the necessary connections, and I'm using SendInput() to emulate the mouse, because, AFAIK SendInput can only emulate keyboard and mouse. And I'm thinking of…
4
votes
1 answer

c++ win32 Simulate Keypress with DirectInput

How can I simulate a keypress with DirectInput? I currently have the initialization (but I'm not sure is it good or not): #include #pragma comment (lib, "dinput8.lib") #pragma comment (lib, "dxguid.lib") LPDIRECTINPUT8 din; // the…
Gaboros
  • 171
  • 2
  • 13
3
votes
2 answers

C++ on Windows: Using DirectInput without a window?

Short version: How do I initialize and use DirectInput if I have no access to the HWND/HINSTANCE? Background information: I am currently using SFML for most parts of my program, amongst others for window creation. Works like a charm. But I'm not…
Mr. Wonko
  • 630
  • 9
  • 17
1
2 3
8 9