|
Post by wolfgang6444 on Jan 13, 2018 8:18:32 GMT
I would like to record the position of a USB-joystick and USB-Pedal while I am gaming. The purpose is to monitor the rudder-aileron coordination on a soaring simulator. I would like to 'tee-fork' the information to some second application that would display/record the coordination.
The feature of replying the simulation with the recorded data is NOT required. What I am looking for is to monitor the stick position while I am playing. The simulator is running on windows 10. Can this be achieved with vJoy?
Wolfgang
|
|
|
Post by Shaul (Admin) on Jan 14, 2018 7:20:02 GMT
Of course you can, but why bother. You can always "listen" to HIDs just like JOY.CPL does. You don't need to own a device in order to listen to it. If you are on Windows 10 then you can use the following APIs: - WinMM legacy API - too old but probably still functional
- DirectInput - Newer replacement with relatively simple API.
- Low level - HidP_xxx and HidD_xxx such as Hidsdi. Only if you are doing something really special.
|
|
evilc
New Member
Posts: 32
|
Post by evilc on Jan 18, 2018 14:17:11 GMT
As Shaul mentioned, you do not need vJoy for this. If you want to write some code to read joystick info, quite possibly your simplest solution would be AutoHotkey.
AHK's joystick support is not great, but for what you want it should suffice. Please note that it can only read from 1st 6 axes of a stick (Because it uses the WinMM API) - however if you need to read all 8 axes, then I have some special code for that.
At your most basic level, let us assume that you want to monitor the X axis of Joystick #1 and log it's position over time to a log file.
This could be done with the following AHK script:
#SingleInstance force #Persistent
lastX := 50
Loop { xpos := GetKeyState("1JoyX") if (xpos == lastX){ return } lastX := xpos FormatTime, TimeString,, yyyy-MM-dd HH:mm:ss FileAppend, % TimeString " X: " xpos "`n", mylog.txt Sleep 10 }
The above code would log out the position of the X axis to MyLog.txt 100 times a second (But only if X changes)
|
|
|
Post by anushri on Mar 20, 2018 6:53:56 GMT
A joystick is an input device consisting of a stick that pivots on a base and reports its angle or direction to the device it is controlling. A joystick, also known as the control column, is the principal control device in the cockpit of many civilian and military aircraft, either as a center stick or side-stick. It often has supplementary switches to control various aspects of the aircraft's flight. www.besanttechnologies.com/training-courses/python-training-institute-in-bangalore
|
|