karn1948 Posted March 19, 2016 Posted March 19, 2016 Hey guys, I'm not sure if this is possible within DCS, but I have an input device for which I can access the data via C++. It does not present itself as an HID / joystick-like device. I am trying to figure out how I can interface with DCS, so that my input device can emulate the function of a mouse clicking on interactable elements in cockpits. Ideally, I could get DCS to simply read it as though it were an actual mouse sending clicks. I've already looked into emulating a mouse at the system level, which can be done but requires writing a Windows driver for a virtual device. Distributing this for 64-bit systems would require paying several hundred dollars to have the driver digitally signed before Windows will allow people to install it. Hopefully I can find another way to make this work.
galen104 Posted March 19, 2016 Posted March 19, 2016 If you don't want to write the HID code stuff by yourself, you can simply get an arduino board and flash it with a joystick HID firmware. You can write there a simple program to read data from your input device and "send" it to the virtual joystick very easily. You can find an example here: http://hunt.net.nz/users/darran/
karn1948 Posted March 20, 2016 Author Posted March 20, 2016 That's a really interesting option. But, I would be a little concerned about latency. Also, I want to distribute this software, and I don't want every user to have to purchase hardware in order to make it work. I can write the virtual device driver myself, I just then run into the issue of getting it digitally signed so that I can distribute it to others. I may go ahead and do that and then make a kickstarter or something to raise part of the funds if there is enough enough interest.
bwRavencl Posted March 20, 2016 Posted March 20, 2016 Not an answer to your original question, but it might be intersting for you anyhow: Check out http://vjoystick.sourceforge.net in case you haven't seen it already. I'm using vjoy as the driver for my own controller software ControllerBuddy and it works just as expected in conjunction with DCS. ControllerBuddy - A highly advanced game controller mapping software (for flight simulators)
glenneuax Posted March 20, 2016 Posted March 20, 2016 Can't interface by lua? Sent from my Nexus 5 using Tapatalk
galen104 Posted March 20, 2016 Posted March 20, 2016 That's a really interesting option. But, I would be a little concerned about latency. Also, I want to distribute this software, and I don't want every user to have to purchase hardware in order to make it work. I can write the virtual device driver myself, I just then run into the issue of getting it digitally signed so that I can distribute it to others. I may go ahead and do that and then make a kickstarter or something to raise part of the funds if there is enough enough interest. Some hardware is needed anyway unless you put some sort of microcontroller inside your custom gaming device. If so, you can use a board like Beaglebone Black (that has an ethernet port and a usb port), flash it with linux, get data from DCS export.lua via network (UDP) and use one one the many HID driver/library.
karn1948 Posted March 20, 2016 Author Posted March 20, 2016 Not an answer to your original question, but it might be intersting for you anyhow: Check out http://vjoystick.sourceforge.net in case you haven't seen it already. I'm using vjoy as the driver for my own controller software ControllerBuddy and it works just as expected in conjunction with DCS. Yep, actually I did a lot of reading and digging through their code to see how they do things. It's been really valuable for understanding how I can get what I need to do working. Still hoping not to have to go that route though. Can't interface by lua? Sent from my Nexus 5 using Tapatalk That's what I'm hoping I can discover here. If there's were a way in lua to effectively do the same thing as you would do with the mouse- sending click events in screen space, that would probably be ideal. Still, I'd have to be able to load a dll or something because I cannot access my input data with just lua. Some hardware is needed anyway unless you put some sort of microcontroller inside your custom gaming device. If so, you can use a board like Beaglebone Black (that has an ethernet port and a usb port), flash it with linux, get data from DCS export.lua via network (UDP) and use one one the many HID driver/library. Completely not necessary, actually. I have a datastream already, and my only issue is turning it into something usable by DCS. The most direct approach would be to simply create a virtual touchscreen device that Windows would read as an actual piece of hardware, write a filter driver for it, and use that driver to pass Windows taps / clicks / etc as though they were being generated by hardware. Then, DCS automatically uses them because as far as it and Windows are concerned, it's an actual mouse / tablet / touchscreen. It's actually exactly how the above-mentioned vJoy (and some other projects) work. The only problem is installing it on a 64-bit system without shelling out lots of money to digitally sign the driver so that people other than myself can install it without jumping through a lot of hoops.
karn1948 Posted March 22, 2016 Author Posted March 22, 2016 Not an answer to your original question, but it might be intersting for you anyhow: Check out http://vjoystick.sourceforge.net in case you haven't seen it already. I'm using vjoy as the driver for my own controller software ControllerBuddy and it works just as expected in conjunction with DCS. Hey I have a question for you: I see that you support mouse movement. My understanding of vJoy was that it only supported emulation joystick / gamepad devices. How have you gotten mouse support through it?
Recommended Posts