Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Greetings to all and Peter...

I've searched through this forum and unless I've missed it, I just can't find anything on mapping an axis to a button press. I might be dreaming, but it seems to me that some time ago, I read of something similar, somewhere in the FSUIPC documentation but , like I said, maybe I'm just dreaming. Oh, well...

Anyway, what I'd like to do is this:

I've disassembled a number of cheap USB gamepads and I've soldered wires to the circuit boards to connect switches to for use in FS.

The issue here is that although the game pads have two "axes" (x and y) as shown in the gamepad controller's properties and calibration applets in Control Panel, the corresponding controls in the gamepad are actually just buttons giving a centered response when not pressed and a full deflection when pressed. I've disassembled at least four different kinds of gamepads and this is true for all of them so far. (Of course, there are other gamepads that do have true axes with potentiometer controls inside, but here, I'm referring to their cheaper cousins.)

I was hoping that there might currently, or in the future, be a way to map these axes to button presses using FSUIPC. For instance, when x axis on device 4 goes to full positive delflection, send such-and-such button/keypress/control. Likewise for full negative deflection as well as pos and neg deflections on the y axis.

This would be very helpful because it would make available four more buttons per gamepad. These buttons are otherwise useless because, as I've mentioned, they are not a potentiometer -- though Windows/FS sees them as axes -- just on/off buttons, and zero/full delfection would hardly be useful with any existing axis of control that FS offers.

Would anyone like to point me in the right direction or let me down gently if there is no hope? I would sure appreciate it.

--

Dennis Diedrich

By the way, Peter, I've been reading this forum and I've noticed the dedication you have to helping everyone who asks for assistance. It makes me feel very good about the money I spent on FSUIPC and WideFS. Even if you can't help me, thanks for all your efforts!

Posted

I just can't find anything on mapping an axis to a button press.

No, I've never done anything like that.

The issue here is that although the game pads have two "axes" (x and y) as shown in the gamepad controller's properties and calibration applets in Control Panel, the corresponding controls in the gamepad are actually just buttons giving a centered response when not pressed and a full deflection when pressed.

Oh, yes. I've seen those types. Always struck me as a big waste of axis inputs when buttons would have done.

I was hoping that there might currently, or in the future, be a way to map these axes to button presses using FSUIPC. For instance, when x axis on device 4 goes to full positive delflection, send such-and-such button/keypress/control. Likewise for full negative deflection as well as pos and neg deflections on the y axis.

Well, it is certainly something that could be added to my list, but it doesn't really fit at present. FSUIPC currently doesn't handle any axes at all -- it does buttons and keys, but axis reading is a rather different matter. The only facilities that may look like axis processing are the Joystick page facilities, which in fact work upon FS axis controls rather than any actual inputs -- FS processes the axis inputs, they are assigned there. All FSUIPC is doing is intercepting the resulting controls inside FS and transforming the parameter values they include.

I did always have in mind a possible joystick axis reading/assignment facility, probably in a separate module, only possibly in FSUIPC, but I've never had time to work on it. That could certainly include options for assigning controls or keypresses, not just at extremes but at any specific positions (for instance, turning a pot into a multi-positioned rotary switch). Maybe assigning "virtual button numbers" instead, which can then be programmed in the Buttons section would be a way of implementing this, I'd have to think about that.

It does get a bit complicated because I'd want to allow the axes to be on WideFS clients too, just as I currently allow buttons from clients to be programmed.

This is a biggish project to do properly, and I wouldn't like to do it piecemeal, and this is why it hasn't actually been scheduled yet.

Would anyone like to point me in the right direction or let me down gently if there is no hope? I would sure appreciate it.

Well, from my side I would not say there is no hope, but at present I cannot commit to the facilities I've outlined, let alone give a date. All I can say at present is that it is certainly something I'm interested in doing at some stage, and it is now firmly on my list.

There may be some other utilities out there which may either do the job already, or possibly could be adapted.

Even if you can't help me, thanks for all your efforts!

Thank you for your appreciation. :)

Regards,

Pete

Posted

Wow! I had never hoped for such a quick and comprehensive response.

-- FS processes the axis inputs, they are assigned there. All FSUIPC is doing is intercepting the resulting controls inside FS and transforming the parameter values they include.

I understand.

I did always have in mind a possible joystick axis reading/assignment facility, probably in a separate module, only possibly in FSUIPC, but I've never had time to work on it. That could certainly include options for assigning controls or keypresses, not just at extremes but at any specific positions (for instance, turning a pot into a multi-positioned rotary switch). Maybe assigning "virtual button numbers" instead, which can then be programmed in the Buttons section would be a way of implementing this, I'd have to think about that.

This sounds exciting!

It does get a bit complicated because I'd want to allow the axes to be on WideFS clients too, just as I currently allow buttons from clients to be programmed.

Even more so!

...it is certainly something I'm interested in doing at some stage, and it is now firmly on my list.

OK, sounds wonderful, Peter. I'll go ahead and wire up the buttons for "future" use. Hate to waste them, y'know.

By the way, if your support is like this even only one-tenth of the time, I would say you still deserve every penny you make from FSUIPC and WideFS. Way to go! and many thanks.

--

Dennis Diedrich

Sylvan Lake, Alberta, Canada

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.