Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider becoming a contibuting member by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

I finished the code for a plugin and am integrating into the plugin skeletal code now. However, I'm hoping there's a more elegant way of performing one of the functions. Basically, I would like to send low level keystrokes in the same way that Autohotkey does. Currently, I made a bunch of Autohotkey scripts, and call them within my plugin. Can somebody tell me a better way to do this?

I sold my cabinet and rehosted everything as a Home Theater PC connected to my HD TV, and use wireless game pads instead of a control panel. The problem is that many emulators have more controls than I have buttons on my game pads. Not ust game controls, but emulator specific controls. On my cabinet, I had a row of extra buttons mapped for just those things. I had to remember what each one did in each emulator. What my plugin does is lets me view a webpage on my laptop, which shows a virtual control panel. I click buttons on my laptop which sends the button presses to my GameEx machine. The best thing is that it changes context when you select a new emulator. So, I don't have to remember what each button does. The virtual control panel is specific to the emulator that I'm currently playing. The client side is just a HTML web page, so you can create any "skin" you want with any HTML editor.

I'm trying to find a better way for the plugin to send the keystroke.

Posted
I finished the code for a plugin and am integrating into the plugin skeletal code now. However, I'm hoping there's a more elegant way of performing one of the functions. Basically, I would like to send low level keystrokes in the same way that Autohotkey does. Currently, I made a bunch of Autohotkey scripts, and call them within my plugin. Can somebody tell me a better way to do this?

I sold my cabinet and rehosted everything as a Home Theater PC connected to my HD TV, and use wireless game pads instead of a control panel. The problem is that many emulators have more controls than I have buttons on my game pads. Not ust game controls, but emulator specific controls. On my cabinet, I had a row of extra buttons mapped for just those things. I had to remember what each one did in each emulator. What my plugin does is lets me view a webpage on my laptop, which shows a virtual control panel. I click buttons on my laptop which sends the button presses to my GameEx machine. The best thing is that it changes context when you select a new emulator. So, I don't have to remember what each button does. The virtual control panel is specific to the emulator that I'm currently playing. The client side is just a HTML web page, so you can create any "skin" you want with any HTML editor.

I'm trying to find a better way for the plugin to send the keystroke.

You could look at the AutoIT ActiveX Control.

Posted
Try that, if not I may be able to send you some .net code.

I looked it over. That should work just fine. Thanks. I'm a software engineer, but this is really my first venture into .NET, so I'm still feeling my way around. I wrote the server side of the plugin as a multithreaded VC++ standalone app, with a sockets interface from the GameEx plugin. I have a loop that polls the socket for new connections. I looked at your plugin API and you do have a timer event that can be called every 2 seconds. Am I to understand that this would really be the only way to incorporate the entire solution into the plugin? I would need to put the socket poll inside the 2-second event.

Thats a bit slower than a user would normally be acustomed to, so I think I'm going to keep the mini-web server a standalone app. The problem is clean up. I can add code in the initialize event to start the app and code to shut it down. Wht I'm worried about is if/when the GameEx app fails and doesn't call the dispose function. Any advice would be appreciated.

Posted
I looked it over. That should work just fine. Thanks. I'm a software engineer, but this is really my first venture into .NET, so I'm still feeling my way around. I wrote the server side of the plugin as a multithreaded VC++ standalone app, with a sockets interface from the GameEx plugin. I have a loop that polls the socket for new connections. I looked at your plugin API and you do have a timer event that can be called every 2 seconds. Am I to understand that this would really be the only way to incorporate the entire solution into the plugin? I would need to put the socket poll inside the 2-second event.

Thats a bit slower than a user would normally be acustomed to, so I think I'm going to keep the mini-web server a standalone app. The problem is clean up. I can add code in the initialize event to start the app and code to shut it down. Wht I'm worried about is if/when the GameEx app fails and doesn't call the dispose function. Any advice would be appreciated.

GameEx should dispose the plugins even if it fails.

What you have to do is use threads if you want code to run more often.

Posted
GameEx should dispose the plugins even if it fails.

What you have to do is use threads if you want code to run more often.

Yeah, I just learned that VB.NET has excellent thread support compared to VB 6. I've written personal tools in VB 6 for years now, and never even considered venturing into DLL hell to write a multithreaded VB 6 app. VB.NET is easy. I should have this knocked out in no time.

The only other piece thats not as ellegant as I had hoped is the HTML push (since an HTML push is impossible). Eventually, I'll probably write an ActiveX app that does the push, but for now I used a little trick. I put a refresh() function call on the onload event, but leave the connection open until the GameEx plugin wants to change context. The onload doesn't occur until all objects have been loaded or at least the sockets are closed. I have one particular image that the embedded web server sends, but doesn't perform a socket.close on it. It adds the socket to a queue instead. When an emulator is started, it calls the corresponding plugin event which calls a function that closes all the queued sockets, and flushes the queue. That causes all the pending onload functions to fire, causing a refresh. The clients always ask for the same page, but the server gives out the page applicable to the running emulator. From the point of view of the user, the IExplorer icon remains spinning and the pages seem to change mysteriously everytime a new emulator is started.

Posted
Yeah, I just learned that VB.NET has excellent thread support compared to VB 6. I've written personal tools in VB 6 for years now, and never even considered venturing into DLL hell to write a multithreaded VB 6 app. VB.NET is easy. I should have this knocked out in no time.

The only other piece thats not as ellegant as I had hoped is the HTML push (since an HTML push is impossible). Eventually, I'll probably write an ActiveX app that does the push, but for now I used a little trick. I put a refresh() function call on the onload event, but leave the connection open until the GameEx plugin wants to change context. The onload doesn't occur until all objects have been loaded or at least the sockets are closed. I have one particular image that the embedded web server sends, but doesn't perform a socket.close on it. It adds the socket to a queue instead. When an emulator is started, it calls the corresponding plugin event which calls a function that closes all the queued sockets, and flushes the queue. That causes all the pending onload functions to fire, causing a refresh. The clients always ask for the same page, but the server gives out the page applicable to the running emulator. From the point of view of the user, the IExplorer icon remains spinning and the pages seem to change mysteriously everytime a new emulator is started.

Sounds nice :)

Posted
Sounds nice :)

I completed the code for the plugin in VC++.NET, but I'm having a hard time converting it to VB.NET for the plugin. Is there a VC++.NET plugin example that I can use to adapt my VC++.NET code natively? Or is VB.NET and C# our only choice?

Posted
I completed the code for the plugin in VC++.NET, but I'm having a hard time converting it to VB.NET for the plugin. Is there a VC++.NET plugin example that I can use to adapt my VC++.NET code natively? Or is VB.NET and C# our only choice?

Sorry, there is no VC++ .net example at this time. I'm guessing it should be possible to do one, but Im really not that great with C++. Im just adequate with it. Sorry.

EDIT: Maybe you can convert the VC code to an activex/com dll or traditional dll, or even .net dll then code the plugin part in c#?

Posted
Sorry, there is no VC++ .net example at this time. I'm guessing it should be possible to do one, but Im really not that great with C++. Im just adequate with it. Sorry.

EDIT: Maybe you can convert the VC code to an activex/com dll or traditional dll, or even .net dll then code the plugin part in c#?

Thats really what I was referring to earlier, but I wasn't sure if an abnormal termination would still cause the correct threads to be terminated. The easiest way to do it that I know of is to just open a shell and run a standalone sockets enabled .exe. The plugin calls would just open sockets to the standalone app. Can I write it as an activex app that links to the GameEx thread at runtime? Is that even possible? Sorry for the never ending questions. Professionally, I'm an embedded software engineer, so the bulkiness of an activex wrapper is usually a luxury.

Guest
This topic is now closed to further replies.
×
×
  • Create New...