Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

UJR - Universal Joystick Remapper (Using vJoy)


  • Please log in to reply
130 replies to this topic
OOZ662
  • Members
  • 3 posts
  • Last active: Aug 22 2013 03:39 AM
  • Joined: 19 Aug 2013

I feel this is probably something really basic, but I'm not sure how to do it.

Is there a way to just pass through the physical hat inputs straight to vJoy? I'm playing a game that doesn't allow any hat or view customization besides "Use hat? Yes/No" If no, then you use the numpad for views (which the remapper could do), but then you can't use the hat to navigate menus which is REALLY handy.



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

Yeah... Hat implementation in UJR is kind of a bodge insofar as in order to avoid having to add a hat tab, I allowed you to map the hat to buttons.

It would require a bit of recoding in UJR, something which I was hoping to avoid until I got around to a long overdue re-write.

Are there any keyboard equivalents for the menu navigation? What may be possible in the interim would be to use a second AHK script to map the joystick buttons (That vJoy pushes when you move the hat) to the menu control buttons.

If you use menu control buttons when no menu is visible, does it do nothing?

If so, then you could maybe use remaps like this:

 

*~2Joy10::Up

*~2Joy11:Down

 

The ~ at the start if the lines tell the macro to not block the underlying button (so eg Joy10/11 would get sent as well as up or down) and the * tells it to work even when Ctrl/Alt/Shift held.

 

Any use?



OOZ662
  • Members
  • 3 posts
  • Last active: Aug 22 2013 03:39 AM
  • Joined: 19 Aug 2013

The arrow keys are the other (non-mouse) method to control the menus, but those are also the pitch/yaw controls combined with the joystick when the menus are closed and aren't unmappable. The view keys also aren't remappable away from the hat switch to regular buttons; it's either HAT-Up/Down/Left/Right and Num-8/2/4/6 or only the numpad. This game is terrible in that regard, partially due to its age (though the newer ones aren't much better), and in fact it not recognizing the "Slider" axis as a throttle (again, "Use Throttle? Yes/No") is the whole reason I'm here to begin with. It seems like it was designed to assume you don't have a joystick and thus everything is always available to be controlled via keyboard whether you like it or not, and makes an assumption that all joysticks are exactly the same except with variable numbers of buttons.

 

If I could set it up to be both the numpad keys (view movement) and the arrow keys (menus and pitch/yaw), it'd still be unusuable since view-up=ship-pitch-up etc.



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

New version of UJR up.

 

Basic support for hat switches is in!

 

"Continuous" hats only (Both my flightstick and xbox controller hats work, so seems good)

 

One hat only (AHK only supports one hat per stick)

 

No "manual control" mode for hats at the moment, so binding games to the virtual hat might be an issue.



OOZ662
  • Members
  • 3 posts
  • Last active: Aug 22 2013 03:39 AM
  • Joined: 19 Aug 2013

Thank you for your continued work; that works like a charm. :)



Ottomic
  • Members
  • 2 posts
  • Last active: Sep 23 2013 02:33 AM
  • Joined: 10 Sep 2013

Hi everyone,

 

I would like to know if it's possible to "shift" axis. The reason for that is that i have a Thrustmaster HOTAS-X, which has a trigger and 4 buttons on the throttle handle. I would like to have 3 virtual sliders (throttle, propeller, fuel mixture) and control them with the same physical slider, by pressing the corresponding button in the lever. So, in a way, I would like to do exactly the opposite as what this script was designed to do.

 

Any help on that? I haven't been able to find anything on it, and I think it would be awesome to be able to control all the levers in my plane without having to lift my hand from the controls, which is kinda the point in a HOTAS setup.

 

Thanks a lot.



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

I have the same stick - well mine is branded Top Gun Afterburner II, but from what I can tell they are identical.
I think I see what you mean - you want to control 3 virtual axes with one physical axis? ie depending on which button you hold when you move the throttle, it manipulates a different axis?
I could see needing to hold a button to set throttle being a pain - using the unshifted state for the throttle may make more sense.
 
Setting up something like this is beyond the capabilities of UJR, but in itself is actually quite simple.
 
What I decided to do is this:
I added a new template to my ADHD macro library that allows for easy programming of virtual joystick apps. This template simply presents a UI similar to UJRs that allows you to select an axis, then manipulates the virtual axis to mimic the physical one.
I have not bothered to do a new release of ADHD for this, if you want the base template you can grab it from the ADHD GitHub page.
 
Then I took that base template and coded the basic functionality that you need.
The beauty of this is that to add the functionality you required to the base template only took about ten lines of code.
For example, this is the default code (Always selects virtual axis 2 for manipulation):
 

vjaxis := axis_list_vjoy[2]

 
And this is the code to do what you want (Selects one of 3 axes dependant on state of the 2 shift buttons):
 

pitch_button := JoyID "Joy6"
mix_button := JoyID "Joy7"
GetKeyState, pitch_state, % pitch_button
GetKeyState, mix_state, % mix_button
if (pitch_state == "D"){
   vjaxis := axis_list_vjoy[6]
} else if (mix_state == "D"){
   vjaxis := axis_list_vjoy[3]
} else {
   vjaxis := axis_list_vjoy[2]
}

I have uploaded it here - both the source code and an executable.
 
At the moment, all the extra functionality is hard-wired. The top thumb button switches to one mode, the second from top button switches to another mode.
If you wish to change these options, you can hard-wire them, or you could delve further into ADHD and add selection boxes to chose which buttons on the stick activate the extra modes.
 
For now, which virtual axes are used is also hard-wired. I picked Y, Z and RZ because those are the default 3 (as well as X, but that may be confusing) that are enabled on a vjoy stick by default.
 
There is no "Manual Control" mode like UJR, but there is nothing stopping you from using UJR to configure the stick in game, then killing UJR and firing up this app.
 
Good luck, hope this helps.
 
evilC



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

I have been thinking about a UJR update / rewrite for a while, and I think I may bite the bullet pretty soon.
 
If you use UJR and have any niggles with the current version, or suggestions for the new version, I urge you to reply to my post on my google groups forum.



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

New version is up, 5.0



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

5.1 is up, now with improvements to QuickBind!

 

It is now possible to bind all functions of the virtual stick to game functions without tabbing out the game!

 

Long story short - hit a hotkey, manipulate the stick to what you want to bind to in game, then hit another hotkey and it sends the desired input after a delay, giving you long enough to activate the game's "bind" function.



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

We are trying to raise the funds to get the vJoy device driver signed, so Test Mode is not needed on x64 OSes.

 

We need to raise about $180, so if you can contribute even $1, please go here and click Donate.

 

Thank you!



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

Version 5.3 has been rolled out with major improvements to "Axis Merging".

 

Please read the changelog if you use this feature - you will need to re-do the axis merging in all your profiles.



evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

Huge new update - 6.0:

 

ADHD Library has updated, if running AHK version instead of EXE version, you must update ADHD!

 

! Profiles from previous versions of UJR are not compatible with this version
  Please delete or re-name uhr.ini
! VJoy library was updated - be sure to copy the contents of VJoyLib folder over old copy!
= Changed Axis Merging mechanism
  Should be simpler to understand now
+ Axes and Buttons unavailable on the virtual stick are now disabled in UJR.
  If your virtual stick only has 16 buttons, buttons 17-32 will be disabled in UJR.
+ Real-time detection of available axes / buttons.
  If you alter the virtual stick config with UJR running, it will detect the changes and update accordingly.
+ Can now control different virtual sticks and swap virtual stick on the fly.
+ Can now run multiple copies of UJR simultaneously.
  Each copy of UJR can control a different virtual stick.
+ Axis Splitting
  Can now use half a physical axis to control a virtual axis
+ Improved Deadzone / Sensitivity support
  Per-axis dz / sens support when doing axis merging
  Rest High / Low mode for applying dz / sens to one end of an axis (For throttle / pedal like axes)
= Fixed bug with Copying profiles (Exiting and reloading would not result in copied profile being the current one)


evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

New version up:

 

6.1 10th Dec 2013
= Fixed bug with axis merging.
  Axis was being flipped in "Rests H" mode, also deadzone was applying wrong.
  Sorry! I have no idea what I was smoking when I wrote that code!


evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

New version up - UJR now supports up to 16 physical sticks, instead of 8.