Can we have more than one Devember project? Let me know if not and I’ll update the thread.
My idea is to have a little HTML page running on your PC which can send keystrokes to your game… or any application that is currently focused for that matter. Some sort of MFD Thingy… but with HTML. In fact, I’m calling it MFD-Thingy or Multi-Function Display Thingy.
The idea here is to access the HTML page over your local network from any device that can run a browser and have controls like buttons you can press which will translate into a key press on the main system.
This is not a new idea, stuff like this has been around for a long time. Most recent example I’ve tried is Game Glass and it just about works on my old little Samsung galaxy A3 (Don’t want to ruin the battery on my new phone). It has a free tier and you can create your own little MFD with the free tier. You can also share your designs. It’s pretty cool and worth a look IMO.
However, after all the google searches I have yet to come across something that runs as a single app/service utilizing hosting a HTML page. If you know of such and example, please share.
How does Game Glass work and why do I want to make my own?
Game Glass, and most such applications, require you to install a app/service on your PC and another app/client on your phone or tablet. The client sends your input from the phone or tablet to the service on your desktop which then simulates a key press.
I want to have just the service and have that service host an HTML page which I can then browse to from any device that has a browser on my local network.
The plan:
Since there is only a few days left for Devember, I’m going to focus on a working proof of concept for Star Citizen and not a complete, user customizable solution. My Gui-Fu isn’t great either and it’s often what takes so much time for me. My day job is shoveling data from point A to point B, not making pretty guis
I will create a little HTML page with a couple of buttons and when you press one of those buttons it will send a Ajax request to the back end which will then simulate a key press on the machine it’s running on. Typically this will be your gaming rig.
I’ll be using ASPNET Core as I can compile the HTML page, javascript, CSS, and C# logic into a single exe. There’s almost certainly a better way, but for now I just want to make it happen. Please share if anyone has ideas.
I’ve already done a very dirty test. Here’s a sneak peak sending a button click from Chrome on my main rig to the service running in the VM. I have tested this from my phone as well.
ToDo:
Create proper project
Create HTML front end with some buttons and basic theming.
Create script to handle buttons press events and ajax call to API.
Create C# logic to translate buttons into key press.
Notes:
-In the before times you could use SendKeys function in Win Forms. At least I think you could use that to send keys to any application. Anyway, this does not exist in ASPNET core. I found a library called H.InputSimulator that works which will do just fine for a proof of concept.
-I don’t want to enable someone to inject script and just send what ever keys they want. For now I’m going to have the buttons represent an Action and then translate that Action into a key server side.
-I also want to limit when a key will be simulated. Basically only simulate a key press IF Star Citizen is running and IF it’s currently focused. Will include notepad in this limitation for testing purposes.
EDIT: GitHub - Nicks182/MFD_Thingy: Web Based Multi-Function Display for Sim games... or any games