XIM Community

XIM4 XIMBridge C#  (Read 3127 times)

Offline chad

  • Member
  • *
  • Posts: 20
    • View Profile
XIM4 XIMBridge C#
« on: 05:24 PM - 12/25/15 »
My son is paralyzed from the neck down...about the only thing he can move is his chin.  He has a joystick on his wheelchair that he uses, and he uses that as a mouse on his computer.

About 2 years ago, I wrote him a small C# application that is basically a picture of an XBOX360 controller, that he can click.  It uses the XIM3, the USB Transfer Cable, etc to allow him to play a few games on the XBOX360 himself.  He loves it!  It gives him a tiny bit of independence. 

I wanted to find out if the SDK/Bridge etc have been updated and will work with the XIM4.  Would I be able to update his application so that he could use it to also control an XBONE and/or PS3, as well as continue to use it for the XBOX360 until all the games he likes to play are playable on the XBONE.

Thanks

Offline trenth

  • MVP
  • *
  • Posts: 1279
    • View Profile
  • Gamertag: TrentHallmark
Re: XIM4 XIMBridge C#
« Reply #1 on: 05:28 PM - 12/25/15 »
@Obsiv @mist4fun @roads @w11ce

Someone answer this man!

Online OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 37837
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: XIM4 XIMBridge C#
« Reply #2 on: 05:58 PM - 12/25/15 »
We have a new version of Commander for XIM4 and one client called "SandhawC" and you use the same cable: http://xim4.com/community/index.php?board=83.0

We current don't have an SDK for XIM4, but, this is something that we can add for you as I don't believe SandhawC is going to work for your specific need.

Where did you get the C# PInvoke interop layer you are using (or did you write it yourself)?
Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline chad

  • Member
  • *
  • Posts: 20
    • View Profile
Re: XIM4 XIMBridge C#
« Reply #3 on: 06:08 PM - 12/25/15 »
Thanks for the very quick replies!  Especially on Christmas day :)  I don't remember where I got it, but it's a C++ project called  XIMBridgeWrapper referencing XIMBridge.dll.

I have mouse down/mouse up events for each of the buttons that set the state of the button when he clicks/releases them, and then I just have a background worker task that calls XIMDevice.SendInput() every 20ms.

There may be a better way to do it, but I was originally just focusing on getting this working for him.

Online OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 37837
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: XIM4 XIMBridge C#
« Reply #4 on: 10:04 PM - 12/25/15 »
You son's current level of mobility enables him to click on different areas of a picture of a controller by driving a cursor using a chin joystick? Does he click by pressing the joystick or is that done using a sip-puff system?

Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline chad

  • Member
  • *
  • Posts: 20
    • View Profile
Re: XIM4 XIMBridge C#
« Reply #5 on: 10:06 PM - 12/25/15 »
He clicks by taking his joystick twice "up".  It's a pretty weird setup, but he's really good at it.

Online OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 37837
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: XIM4 XIMBridge C#
« Reply #6 on: 10:19 PM - 12/25/15 »
Can he do that at any position of the stick, or, does he return to center to click?
Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline chad

  • Member
  • *
  • Posts: 20
    • View Profile
Re: XIM4 XIMBridge C#
« Reply #7 on: 10:21 PM - 12/25/15 »
I believe he returns to center.  He double taps right to alternate left and right, and double taps up or down, not sure which, to alternate up and down, then double taps the other direction for his click.  I believe he double taps left to lock his click so he can click and drag.

Online OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 37837
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: XIM4 XIMBridge C#
« Reply #8 on: 11:25 PM - 12/25/15 »
Ok, I was curious if it would be at all possible to enable something like this (below) based on the position of the stick. I, of course, have no idea what is or is not feasible given the setup in question, but, I wanted to ask (although I'm sure you've considered it).
Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline chad

  • Member
  • *
  • Posts: 20
    • View Profile
Re: XIM4 XIMBridge C#
« Reply #9 on: 02:02 PM - 12/30/15 »
Sorry for the delayed response.  I was out of town.  I've considered that before, but because of the way he has to double tap to switch the direction he's moving his cursor, and not being able to hold the mouse cursor in a specific spot, I don't think it will work

Online OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 37837
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: XIM4 XIMBridge C#
« Reply #10 on: 04:52 PM - 12/30/15 »
Perhaps I'm misinterpreting his setup. It sounded like you had an app that displays a picture of a controller and he puts the cursor over the function he wants and then clicks. Is that correct?

If so, how do you have the joystick mapped for manipulating the cursor?
Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline chad

  • Member
  • *
  • Posts: 20
    • View Profile
Re: XIM4 XIMBridge C#
« Reply #11 on: 04:58 PM - 12/30/15 »
http://pasteboard.co/qGYPH6l.png

That's a picture of his interface.  I think I get your idea now, instead of him having an image of the entire controller, moving all the buttons closer together....that might could work, I will talk to him and see what he thinks...But that's a simple matter of changing the click events.

Do you still think you'll be able to provide an updated sdk/api to work with XIM 4 and the XBOne?  Would it also be compatible with the X360? PS3?

Thanks for all your help.

Online OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 37837
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: XIM4 XIMBridge C#
« Reply #12 on: 08:17 PM - 12/30/15 »
Yes, this will work with X360 and PS3 as well. I can set you up with something right now but it will require you to talk to Manager via an IPC pipe (which is the way it's done now -- you talk to Manager and Manager talks to XIM4). If you aren't comfortable with that, I can turn it into an SDK, but, it'll take a couple weeks.
Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline chad

  • Member
  • *
  • Posts: 20
    • View Profile
Re: XIM4 XIMBridge C#
« Reply #13 on: 08:20 PM - 12/30/15 »
I am not in a rush, I still need to order a xim4 and I'm in the middle of moving, just sold my house, so I can wait a little bit.  Thanks again!

Offline tuffrabit

  • MVP
  • *
  • Posts: 7352
    • View Profile
    • tuffrabit's Twitch.tv channel
  • Gamertag: TuFFrabit
Re: XIM4 XIMBridge C#
« Reply #14 on: 08:24 PM - 12/30/15 »
I wrote that XIMBridgeWrapper managed C++ project back in the day for the original SDK. I think the source for that still may even be in my sourceforge.

I remember you chad. I remember you asking for help with this originally, at least a year or two ago.

I dunno how familiar you are with Python, but I have a Python module that implements OBsIV's IPC pipe protocol. Even if you don't want to write a Python GUI app around it, you could use it as a reference. You might even be able to just copy and paste my code into a .NET IronPython project and then write C# on top of it for the GUI layer.


XIM4 Anti Aim-assist curve: http://xim4.com/community/index.php?topic=31309.msg400143#msg400143
All you ever wanted to know about headsets and chat for the 360: http://www.xim3.com/community/index.php?topic=16461.0