Questions tagged [directinput]

139 questions
4
votes
2 answers

Using DirectInput with XBOX One controller and window focus on Windows 10

I am trying to use DirectInput to capture XBOX One controller input signals. I am tying it to a C# WinForms application. The issue I am having is: When the form has focus, it captures inputs just fine. When the window loses focus, I don't get any…
Andy
  • 12,859
  • 5
  • 41
  • 56
4
votes
5 answers

GetRawInputData vs GetAsyncKeyState()

Well, I'm trying to avoid using the deprecated DirectInput. But I need, at each "frame" or "iteration" of the game to snatch ALL KEY STATES so that I can act accordingly. For example, if the player is down on the VK_RIGHT key then he will move just…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
4
votes
0 answers

DirectInput C++, Steering Wheel and DIVIRTUAL_DRIVING_RACE Access

I'm new to direct input. I managed to initialize my Steering Wheel as a DI8DEVCLASS_GAMECTRL device and get all data. Now pedals are a bit of a pain, since they share one axis (accelerate is doing the Y-Axis positive and brake is doing negative…
partycle
  • 41
  • 2
3
votes
0 answers

C++ DirectInput Mouse Scroll Wheel with a Laptop Touchpad

When using DirectInput, it is my understanding that the mouse wheel delta should be stored in DIMOUSESTATE objects lZ variable. However, when I am scrolling with my laptop touchpad instead of an actual mouse with a wheel, it seems like the scroll…
M. Laing
  • 1,607
  • 11
  • 25
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
  • 690
  • 9
  • 17
3
votes
1 answer

How to implement Joystick code using in C++ using Microsoft's IDirectInputDevice8?

I need to do blocking and non blocking calls to poll on an Direct Input device using IDirectInputDevice8 interface. In linux to do blocking, we use select ex: while( ::select(_jdev+1, &set, NULL, NULL, &tv) > 0) { if( ::read( _jdev, &js,…
luke signh
  • 139
  • 2
  • 13
3
votes
1 answer

SendInput to background window

I want to send the mouse and keyboard input, which is recieved from android client, to games running on windows. SendInput works for almost all games I have worked so far. But for SendInput to work the game must be a foreground window. To solve that…
SMUsamaShah
  • 7,677
  • 22
  • 88
  • 131
3
votes
0 answers

How is the guidProduct field of DIDEVICEINSTANCE generated

How does DirectInput generate the GUID for the guidProduct field in DIDEVICEINSTANCE? The documentation reads: guidProduct Unique identifier for the product. This identifier is established by the manufacturer of the device. I am searching for a…
The Fiddler
  • 2,726
  • 22
  • 28
3
votes
0 answers

Best way to capture user input in game

I am trying to figure out the best way to work with user input in OpenGL games for Windows. I have four options on my mind: (1) Just peek messages for the game window inside main messages loop, which contains also rendering, like this: while…
Cruel_Crow
  • 359
  • 3
  • 15
3
votes
1 answer

Separate input for additional 10-key keypad

I am writing Windows DirectX 11 software in C++ for which I would like to receive input from both a regular keyboard and a 10-key keypad. I would like a secondary user to be able to input from a 10-key keypad without disrupting the use of the full…
Tim Coolman
  • 595
  • 1
  • 9
  • 19
3
votes
1 answer

How do I send release key with directInput?

I want to send keys using direct Input.I was able to send key press.However i do not know how to send the key release to avoid keeping key pressed. Here is my code: struct INPUT { public UInt32 type; public ushort wVk; public ushort wScan; …
Marks Mal
  • 41
  • 5
3
votes
1 answer

Touchpad's absolute touch coordinates

Is it possible to read input directly from a Alps touchpad? I am trying to turn my touchpad into a cheap drawing tablet so I need to read the raw unprocessed x and y coordinates of where it was touched relative to the physical touchpad. So if I…
Franklin Ta
2
votes
3 answers

USB Joystick with C++ and DirectInput

I've been trying to read data (x/y axis, pressed buttons, etc) from a usb joystick, and I've heard of DirectInput. Been searching for some long hours to find a decent example or walkthrough with little success. If anyone can share a simple tutorial,…
tdgtyugdyugdrugdr
  • 786
  • 4
  • 13
  • 31
2
votes
1 answer

Trouble printing DIDEVICEINSTANCE tszProductName to Windows Console

I've been following a DirectInput tutorial and am having trouble printing a list of DirectInput device product names to a Windows console. I'm using VS19's C++ compiler and am compiling with UNICODE defined. Since tszProductName is of type TCHAR…
Sencillo
  • 21
  • 1
2
votes
0 answers

How do I prevent non connected Joystick from crashing my DirectInput API based application?

The Joysticks works as expected except that if it's not plugged my app crashes. The interesting thing, I used it on the computer that I make the development in, it does not crash when not plugged, only on other computers. So that's something to keep…
Sam Gomari
  • 733
  • 4
  • 13
  • 37
1
2
3
9 10