Questions tagged [directinput]
139 questions
2
votes
3 answers
Why can I not acquire the keyboard with DirectInput?
I just started getting into DirectInput today, using DirectInput8 with MinGW on Windows 7 Ultimate N. I started off with a simple program to report which keys are currently down every second (just codes, not readable keys). However, I can't even get…

chris
- 60,560
- 13
- 143
- 205
1
vote
1 answer
Python module that allows mouse movements in DirectX
Does anyone know of a Python module that can move the mouse while in a directX game?
I have tried Ctypes and Hammonds win32 module and they don't work in directX due to DirectInput blocking normal python modules from accessing the mouse.
Is there a…

user1288323
- 11
- 2
1
vote
1 answer
Game Wont Start
I'm using DirectInput with XNA however for some strange reason my game will not start when I have the following code implemented:
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
That…

MrSplosion
- 183
- 1
- 3
- 10
1
vote
1 answer
how to determine keyboard disconnected in DirectInput
I am monitoring HID connections using EnumDevices(..., DIEDFL_ATTACHEDONLY). When I disconnect a game controller it no longer shows up in the callback. However, when I disconnect the keyboard, it still shows up in EnumDevices.
I've looked through…

RunHolt
- 1,892
- 2
- 19
- 26
1
vote
1 answer
Call and Execute a Function on a DLL using VBScript
My target DLL file is Microsoft DirectInput dll file which is located here:
C:\Windows\System32\Dinput.dll
I have monitored an application which uses it for API. I just see that it has call for "DirectInputCreateEx" on Dinput.dll and I did not found…

Inside Man
- 4,194
- 12
- 59
- 119
1
vote
1 answer
How to control the perspective of a unity game using python?
I want to simulate mouse movement through Python, so that the perspective of the Unity game rotates accordingly.
I used pydirectinput.moveTo() to move mouse. Used pydirectinput.keyDown() and pydirectinput.keyUp() to input key.
It can work in…

Aehcaoiggc
- 11
- 1
1
vote
0 answers
pydirectinput not moving mouse consistantly
I play this game that i would like to automate which requires little mouse movement as well as some keyboard inputs. While the code works(most of the time), sometimes it dosnt move the mouse all the…

Wiz Ninja
- 19
- 1
- 5
1
vote
1 answer
glfwInit() freezes program
The program gets stuck at the glfwInit() function. However, there are no error messages and glfwInit() doesn't come to a stop. It's like the main thread is sleeping or run into an infinite loop. This problem seems not to be project-specific because…

Sebphil
- 488
- 5
- 12
1
vote
1 answer
Simulating keystrokes with python for P3D flight simulator
I want to simulate key presses within P3D flight simulator. I am using the following code to simulate a repeating F4 keystroke.(Code taken from here)
import ctypes
import time
SendInput = ctypes.windll.user32.SendInput
# C struct…

Kevin
- 61
- 6
1
vote
0 answers
How to do Direct Input Gamepad in Python
So I want to do a direct input from gamepad in python. All I have found from the internet is with PYXinput, but it seems when I try check it with x360ce and vjoy, it doesn't do anything. Do anyone know how to do the direct input with a gamepad? or…

glen hendi
- 11
- 1
1
vote
1 answer
Direct Input in Euro Truck Simulator not working
I'm trying to create autonomous truck in Euro Truck Simulator 2, using PIL for image capture, OpenCV for image processing and tensorflow for action prediction.
The only problem is I am not able to send input to Euro Truck Simulator 2 game.
I am…

makarand-mac
- 26
- 3
1
vote
2 answers
How to keep pynput and ctypes from clashing?
I'm using this gem from somewhere on this site.
import ctypes
import pynput
SendInput = ctypes.windll.user32.SendInput
W = 0x11
A = 0x1E
S = 0x1F
D = 0x20
# C struct redefinitions
PUL = ctypes.POINTER(ctypes.c_ulong)
class…

Duck Wizard
- 61
- 1
- 8
1
vote
0 answers
Prevent game from capturing mouse
I'm working on a program for accessible PC gaming for people with mobility limitations. It will be like an on screen keyboard, except it will be a game controller. The problem is that most games capture the mouse input, so the user won't be able to…

dude8604
- 171
- 1
- 10
1
vote
1 answer
2 Mice, capturing exclusively one mouse on windows (DirectInput, DDK, Linux, anything)
I have connected 2 mice to PC and I wish one mouse to work as regular mouse and capture second mouse exclusively.
First I was trying DirectInput. It showed 2 devices with word mouse in InstanceName.
But only one device had DeviceType.Mouse and it…

Max
- 6,286
- 5
- 44
- 86
1
vote
1 answer
Convert DirectInput codes into keycodes .net
I need to find a way to convert directinput codes into .net keycodes. Forgive me, the whole key input thing baffles me. The example would be if i grab a key via:
Private Sub GetKey(sender As Object, e As PreviewKeyDownEventArgs) Handles…

stigzler
- 793
- 2
- 12
- 29