Cleric-K / vJoySerialFeeder

Feed Virtual Joystick driver with data from a serial port
GNU General Public License v3.0
258 stars 55 forks source link

Awesome Project! #1

Closed safrazik closed 6 years ago

safrazik commented 6 years ago

NOT an issue!

I found this via http://forum.arduino.cc/index.php?topic=515259 I haven't used it yet but I just can't stop me from making this comment. It is so overwhelming to see all your work. You have done an amazing job. Thank you for sharing it with the world. I went throgh the C# code, Sketch code and the documents. I can understand your great work because I have already developed a similar concept and using it for a personal project. But I haven't done mapping in any protocol way - that's the difference, instead I send serial strings from arduino for any analog or digital input and in the c# software it can be mapped to vjoy or mouse events or keyboard events.

Please keep up the good work. I'm going to try this out and will get back to you shortly. I would like to contribute as well. In fact I wanted to make my solution open source but I think your work is better than mine so I think I can use the knowledge I got from working with my solution - into your project. I hope you would welcome it.

Only few things I see missing is that, I have a rotary encoder which will translate to a vjoy axis. I think your solution doesn't have a built in way to to support rotary encoder but I think it can be done in the arduino sketch - it should be very easy.

Once again, Thank you for the project. This project will rock for sure!

Cleric-K commented 6 years ago

Hello,

Thank you for your interest in this project!

This project got it's start from a simple need to read the potentiometers of a toy RC controller (with Arduino) and somehow use them as joystick inputs. At first I used serial strings - just as you do - and a simple console C# app to feed the data to vjoy. Then I found out that RC receivers output their data through UART pins and they can be read directly by the PC (through UART USB converter). That's why I implemented the IBUS protocol (used by FlySky controllers) and only after that decided that arduino projects may also use that protocol for data serialization.

Simulating mouse and keyboard events may quickly make an application very complicated, since there are so many different scenarios that may arise (for mapping to key combinations with delays and so on). Very often, supported features will be either quite rudimentary and cover only very basic scenarios, or if more comprehensive features are required this quickly leads to very complex app. This can take a lot of time and effort. In my opinion there is no real need to "reinvent the wheel" - as open source community we should always leverage whatever possible from existing projects. One way to accomplish these requirements is by using AutoHotkey. Colossal energy has been invested in this project and it can be used to achieve almost anything!

I think that VjoySerialFeeder should stay focused on what it's purpose is (it's in the title of the project itself) -to act as a bridge between the serial world and vJoy.

Once the information reaches vJoy you can use AutoHotKey to achieve practically anything! You can simulate mouse, keyboard - simple or with complicated scripted actions, you can execute programs... really - anything. Check out https://autohotkey.com/docs/misc/RemapJoystick.htm.

(interesting idea for another project would be to make a serial plugin for AutoHotKey - thus you can read the serial data directly and map it to anything you want in AHK)

Of course if you have any ideas which fall into the focus of this project I'll be glad to hear. And about the rotary encoder - yes, that's what the Arduino directory is for - more examples can be added there.

Thank you

safrazik commented 6 years ago

I agree with you. Even though I created keyboard and mouse support, I didn’t need to use it because I ended up using only Vjoy buttons. But I had a web socket server with the c# app that emits the mapped data which can be consumed by any web client for any purpose, e.g: to display a customised UI for the controller events.

I managed to port my Arduino controller to work with your feeder without ANY change in hardware setup. I only had to write the correct sketch and add some mappings in the app, and it just works! The 16bit mapping is a killer feature!! I For rotary encoder, I used Arduino’s map function to map to 0, 1023 from -100, 100 Which I earlier did in the c# application.

safrazik commented 6 years ago

The exe file in the release didn’t work (Windows 10). I built the project (in Visual Studio 2015 Community) and it worked fine.

Cleric-K commented 6 years ago

I'm very very happy that the project worked for you!

I also agree that some kind of IPC feature will be useful. This really opens the door for any power users to use the data in anyway they want. Do you have any experience with COM (component object model)? First I have some more urgent features to implement, then I'll also think about IPC.

Can you help me find out more about the error with the release build? Did it throw some meaningful exception? I've tested it with Win 7 64bit and 10 and seems to work.

Cleric-K commented 6 years ago

Hello @safrazik , I have implemented some new features. There is WebSocket and COM interaction. I hope you'll find them useful. Checkout the releases and docs for more info.

safrazik commented 6 years ago

Wow! Awesome @Cleric-K I was busy working on a mobile app. I’m super excited about your update. I will get back to your project hopefully within one week.

safrazik commented 6 years ago

Hello @Cleric-K sorry for the delayed response. I played with the new features, especially WebSocket implementation. It is fantastic. Works perfectly. I created my own dashboard view (for Driving Simulator). I have plans to extend it to customizable/skinnable dashboard for various type of games (Airoplane Simulator, Driving Simulator, etc) Once I am done with it, I will make it open source and let you know. Thanks for the new features

Cleric-K commented 6 years ago

Great! I'm happy that the projects was of use!