In my continuing series of "plugins that are almost totally useless but look kinda cool"...
This plugin monitors the status of an XInput controller. If you're working in, say, Unreal Editor 4 and want to see the raw values of your connected controller, this plugin is for you. If I'm really motivated/bored I might do a DirectInput one.
The example skin is pretty crappy art-wise, but the code works. Enjoy!
dave
You do not have the required permissions to view the files attached to this post.
I've been out of the loop for a while now, but this was interesting enough to bring me back in for a bit.
Anyway, I played around with it a bit and it works really well. No lag or heavy CPU usage that I can see which is always a plus. I did decide to rework it for myself and add a bit of an interface to keep track of things a bit easier and figured I'd share what I whipped up.
A few issues (with my coding, not the plugin) are that I need to rework the IfConditions for the Joystick directions as it seems to hang a bit in places with a jerking motion here and there, add some styles and generally just clean it up, but it's here if anyone wants to play with it.
I've also added a gif below so you can see exactly what it is and download it as well.
Xinput Interface Demo.gif
Xinput Interface_1.0.0.rmskin
You do not have the required permissions to view the files attached to this post.
Sweet! That's exactly the kind of art I was too lazy to do. Nice one!
Oh I forgot to put in my original skin - there's a channel called "Connected" to report if the controller is plugged in, but I didn't test it. So the full list of options:
As far as I can tell all of the channels work properly. The connected status in my skin is represented by the center guide button turning green and going grey when unplugged. The gif I made starts out unplugged and grey.
As for the device (0-3) option I'm not sure what that is. Could you elaborate a bit more on that?
Apparently you can connect up to 4 controllers (though I only have 1). The Device # lets you address the other 3, if you have them.
I couild probably whip up a DirectInput version pretty quick if anyone was interested, or just kick the code up to github I guess. The only question is whether DirectInput allows shared access to the same ID. (e.g. I wouldn't want to disconnect the controller from your game so that I could show the values in Rainmeter) The XInput API is really simple and doesn't seem to mind getting queries from multiple apps at the same time.
I'm sure I have a spare controller lying around, but I'm not sure if it's wired or not and I don't have a wireless adapter. If I get a chance though I'll play around with the device list. I'd also be interested in seeing what the differences would be between this and the DirectInput version, but I suppose that that's up to you.
I made a nice clean skin, but I had to modify the Rainmeter code to support ATan2 in the math expression parser, so it won't work on anyone else's build until that change gets pulled into the main branch. I'll upload it once that change goes live.
dave
You do not have the required permissions to view the files attached to this post.
I had tried to create a skin almost identical to that following the graphical version I made, but couldn't properly translate the magnitude on the axis of the joysticks to create the direction of the line within the circle.
Perhaps I'm just slow, but I also found the aTan function less than helpful on this.
Nope, atan is almost useless. You want atan2, but for some reason it wasn't included in Rainmeter's math functions until I added it over the weekend. Just need to poke one of the other guys who makes builds to pull the change in.
dgrace wrote:Nope, atan is almost useless. You want atan2, but for some reason it wasn't included in Rainmeter's math functions until I added it over the weekend. Just need to poke one of the other guys who makes builds to pull the change in.