Universal Joystick Remapper (UJR) - v6.10 2nd Nov 2015

Post gaming related scripts
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Universal Joystick Remapper (UJR) - v6.10 2nd Nov 2015

21 Dec 2014, 14:21

Please note: UJR is no longer maintained, please use UCR instead.

What is it?

A program to combine axes, buttons and the 1st hat from any of your physical joysticks into one or more 8 axis, 32 button virtual joysticks.
it should work with any game.
If the joystick you wish to use appears in Windows' game controller list, it should work with UJR.
It is a full standalone "App". You do not need AHK installed to use it. You do not need to know how to code to use it.
 
Why would I want it?
  • Your joystick is not recognised by the game
  • Your joystick is recognised, but an axis is the wrong way around and you cannot fix it.
  • You have a pair of racing pedals that feature an axis for each pedal, and wish to use them as a single rudder axis.
  • You want to use two devices for a game (eg a pedals and a stick/throttle) for a game but it only supports one joystick at a time.
  • You want a specific feature, but lack the knowledge to write such a thing yourself. The code is pretty easy to understand and you just need a text editor.
Features
  • "Portable" application, no installation required - just run the EXE!
  • Control up to 16 virtual joysticks with 8 Axes and 32 Buttons each!
  • Controlled by up to 16 physical joysticks
  • Invert any axis
  • Per-axis deadzone and sensitivity settings
  • Axis Merging - Combine two racing pedals into a rudder!
  • Axis Splitting
  • Axis Trimming - Use one axis to trim another.
  • Reads up to 6 Axes from input sticks.
  • Remap the 1st Hat (POV) switch to any buttons.
  • Settings saved between uses
  • Profile support
  • Run multiple copies - each copy can control a different virtual stick
    (But each version can read any of the physical axes)
  • "QuickBind" mode to control the virtual joystick via the UJR GUI 
    Use this when the game detects the underlying physical stick instead of the virtual one - allows you to move the virtual stick without moving the physical stick
How does it work?
  • Uses the free open source app vJoy to create a virtual joystick
  • UJR is written in AutoHotkey, an open source macro app - it sends instructions to vJoy via Axlar's vJoy to AHK Bridge.
  • Configure UJR to tell it which physical joystick axis/button controls which axis/button of the virtual joystick - each axis and button of the virtual stick can be mapped to a different physical joystick
Limitations
  • Does not support mapping joystick to keyboard or mouse.
    Use regular AHK to read the output of the virtual stick and send keyboard or mouse.
  • Does not support reading input from the 7th and 8th joystick axes.
    This is due to an AHK limitation.
  • Does not support reading input from the 2nd-4th POV hats.
    This is due to an AHK limitation.
Can I modify and freely distribute it?
Yes, if you add a cool new feature, or know a better way of writing a bit of the code, please let me know!
 
Cool! Where can I get it?
 
Direct Download: 
http://evilc.com/fil...hk/vjoy/ujr.zip
 
Homepage:
http://evilc.com/proj/ujr
 
GitHub Page:
https://github.com/evilC/AHK-Universal- ... k-Remapper
 
We now have a signed driver, so Windows 7 x64 users no longer need to use Test Mode!
 
Full instructions are in the readme inside the zip
 
Image
Last edited by evilC on 03 Mar 2017, 08:48, edited 4 times in total.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

21 Dec 2014, 18:09

UJR Changelog

Key:
! : Warning
* : Comment
= : Change / Fix
+ : Added feature

6.9 - 8th Oct 2015
+ Compiled with ADHD 3.3.3
As a result, you should no longer get a UAC prompt every time UJR starts. You should see it once, then it should not appear again.

6.8 - 6th Oct 2015
= Functionality Toggle binding now works. You can turn on/off UJR's functionality with this binding.

6.7 - 16th July 2015
= Greatest mode now works in a more logical manner - it should now behave similarly to Merge mode.
= CPU load reduced - GUI controls for axes that are not being used are no longer continually updated.

6.6 - 24th Dec 2014
! Now tries to use the vJoy DLLs from the vJoy installation folder.
PLEASE ENSURE YOU ARE USING THE LATEST VERSION OF VJOY!
+ Added in-app links to Github / Forum etc.
= Fixed bad maths. UJR now correctly uses output values in the range 0->32768, not 0->32767
Shouldn't really affect much, such a small deviation was probably never noticed!
= "Greatest" merge mode fix for pedals (Rests L/H axes) - thanks to CJBrew for this one!
! For those that use the AHK version, the vjoy library is now a separate project:
https://github.com/evilC/AHK-vJoy-Library

6.5 26th Aug 2014
+ Trim mode added to axis merging features - you can now use one axis to trim another axis.
Code contributed by PhoenixBvo, thanks!

6.4 22nd May 2014
= Updated to use latest version of ADHD
+ Bindings tab changed - no more Program Mode or ticking of Ctrl, Alt, Shift boxes.

6.3 12th Dec 2013
= Fixed missing 9-16 option for dropdowns to select stick ID for buttons, hats etc.

6.2 12th Dec 2013
+ UJR now supports 16 physical joysticks (The max windows supports), instead of 8.

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!

6.0 7th Dec 2013
! 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)

5.4 30th Nov 2013
= Modification to VJoy library - it can now correctly control virtual stick IDs other than 1.
No actual changes to UJR, but it would now be easy to make UJR control any virtual stick ID (Currently thru a code edit).
BE SURE TO COPY THE VJOYLIB FOLDER FROM THE ZIP INTO YOUR UJR FOLDER - THAT IS WHERE THE MAIN CHANGE IS!

5.3 25th Nov 2013
= Reduced likelihood of a merged axis "kicking" in one direction.
Previously, when building the virtual axis, the value of the first axis would be applied,
then the value of the second axis would be averaged in and the virtual axis would be set again.
This could result in jerky movement if there was too long between the two physical axes being processed.
The virtual axis is now only set when both physical axes have been read and added together.

5.2 25th Nov 2013
! Axis merging has changed!
It is now much less confusing to set up - configure each axis individually to move the slider in the direction desired.
eg set the left pedal to move the slider left (from a resting position all the way right), right pedal to move it right.
Then set both axes to the same virtual axis and enable merge - it should behave as expected.
+ Now detects if something else is controlling the virtual stick (maybe you tried to run ahk and exe versions of UJR?) and exits.

5.1 21st Nov 2013
+ Added "QuickBind" function - bind game functions without leaving the game!
Instead of manually selecting an axis or button by using the QB radio button, you can use QuickSelect.
Bind QuickSelect to something, and when you hit it, press a button or move an axis.
The relevant axis or button will then be selected for you.
+ "Auto Configure" function - quickly set up a straight through mapping for all buttons or axes.

5.0 20th Nov 2013
* Rewrite using my ADHD library.
! Now intended to be used when compiled to an EXE - You no longer need AutoHotkey installed.
! Old profile files are NOT COMPATIBLE.
However, it is just the groups etc in the INI that will not work right.
If you create a new profile, exit UJR and paste in the contents of the old profile, it may well work.
= Manual Control is gone, replaced by QuickBind
= Profile support improved
= Less tabs
= Improved hat switch support (QuickBind supports hats, whereas Manual Control did not)
= Detect Axis gone for now, it will probably return

4.3
+ Basic Hat (POV) switch support.
As AHK only supports one hat per stick, it is very basic for the moment.
It currently only supports Continuous POVs.
Currently there is no "manual control" mode for the hats

4.2
= Duplicate in profiles was always duplicating the Default profile, no matter what you had selected - fixed.
+ Added Delete Profile button

4.1
+ Duplicate profile added.

4.0
+ Profile support added.
INI file format changed, there are now two INI files - one for misc settings, one for profiles
Existing mappings are kept and moved to the default profile
Manual profile switching only for now...

3.2
+ The first physical POV Hat can now be mapped to virtual buttons. AHK only supports reading one POV :(

3.1
+ Sensitivity option for each axis.

3.0
! Please note that the format of the config file has changed, the program will back your old one up
= Fixed bug stopping button mappings not saving
= Improved UI layout, labels etc
= Major cleanup of code - now much more understandable
+ GUI position now saved in config file - when you close the app, next time you reopen it, it will be in the same place on your desktop
+ Only settings changed from their default setting are stored in the config file
+ Detect axis button! Use this to try and find out the stick ID of a physical stick.
Instructions now simplified
+ Experimental - Merging of axes
eg Merge two pedal axes into a rudder axis


2.3
+ Much improved deadzone code
So with a 50% deadzone, if you move to 50 on an axis, it will be dead, but moving to 51 now outputs 1 rather than 51
+ Deadzone is now a text input field, so you can use any value you like
+ Input / Output slider renamed to "State"
+ Input and Output values for axes now displayed
+ Much more commented code

2.2
+ Added per-axis deadzone settings. Just 5,10,20,30,40,50,60,70 or 80 percent at the moment but I intend to allow any figure in a future version

2.1
= Fixed bug stopping UJR from working on 64-bit AHK installs.
= Fixed bug stopping mapping of virtual axis 4 or greater
+ 32 Buttons listed for physical joystick

2.0
+ Now uses Axlar's vJoy library (http://www.autohotkey.com/board/topic/8 ... ntrol-vjoy)
+ Now uses vJoy 2.x - Support for up to 32 buttons
You will NEED to uninstall vJoy 1.x and install 2.x to use this version

1.1
= Code for button testing no longer has one subroutine per button
= Optimised technique for inverting axes - thanks Babba on AHK forums!

1.0
* Fully functional basic version!
= Fixed bug stopping invert working in Manual Control mode
+ Button mapping in

0.3
+ Settings now saved in an INI file

0.2
+ All 8 axes now mappable
+ Code optimisations

0.1
* Initial Proof of concept
Last edited by evilC on 08 Oct 2015, 18:32, edited 2 times in total.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

24 Dec 2014, 13:25

UJR 6.6 Has been released.

PLEASE UPDATE TO THE LATEST VJOY VERSION TO USE THIS RELEASE.
This version or any later version is required.

This new release (Along with the new vJoy version) should solve all Win8 issues.

For those using the AHK version instead of the EXE version, please be aware that UJR now uses the updated AHK vJoy Library

Changelog:

Code: Select all

6.6 - 24th Dec 2014
! Now tries to use the vJoy DLLs from the vJoy installation folder.
  PLEASE ENSURE YOU ARE USING THE LATEST VERSION OF VJOY!
+ Added in-app links to Github / Forum etc.
= Fixed bad maths. UJR now correctly uses output values in the range 0->32768, not 0->32767
  Shouldn't really affect much, such a small deviation was probably never noticed!
= "Greatest" merge mode fix for pedals (Rests L/H axes) - thanks to CJBrew for this one!
! For those that use the AHK version, the vjoy library is now a separate project:
  https://github.com/evilC/AHK-vJoy-Library
PrimeTimeAction

Re: Universal Joystick Remapper (UJR)

04 Jan 2015, 15:37

Hi I am struggling to make it work with Far Cry 4. I only need to swap buttons 1,2&4 with each other. I followed your guide and everything went as you mentioned, however in the bind game part do not understand the following "double click the entry in the game's bind options that you wish to bind your up axis to." What exactly am i supposed to do . There is noo in-game bind option.
Regardless i tried to use quickbind and quickbindselect and always i end up binding button to axes. Please help!
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

05 Jan 2015, 09:50

"double click the entry in the game's bind options that you wish to bind your up axis to." What exactly am i supposed to do . There is noo in-game bind option.
Are you sure? there is no control configuration menu in Far Cry 4? Or do you mean no config menu for gamepads or something?
PrimeTimeAction

Re: Universal Joystick Remapper (UJR)

06 Jan 2015, 01:11

evilC wrote:
"double click the entry in the game's bind options that you wish to bind your up axis to." What exactly am i supposed to do . There is no in-game bind option.
Are you sure? there is no control configuration menu in Far Cry 4? Or do you mean no config menu for gamepads or something?
Thanks alot for your response. There are two controls configuration menus, one is for keyboard & mouse and the other one for joypad. The one with joypad shows a typical xbox controller with buttons labeled for function. e.g "A" to jump, "B" for cancel, e.t.c. It does not allow to change any buttons. With my joypad all buttons are working but the problem is that the buttons for B,X&Y are switched (wrong location). for example, button A in game correspond to Button 3 of my joypad, button B in game correspond to Button 4 of my joypad and so on. I want to change this so that button A in game correspond to button 1 in joypad and so on.

I hope this clarifies my problem. I will appreciate any help in this regard.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

06 Jan 2015, 10:28

And I take it that there is no way to choose which joystick you want to use (vjoy or xbox controller).

Your most likely way to solve this is to launch the game without the xbox controller plugged in.
That way, the game should have no choice but to use the vjoy controller.
Once the game has started, plug the xbox controller back in, and hopefully the game should not recognize it.
Then, just configure UJR as desired, you can ignore quickbind.

Absolutely shameful that a company can release an AAA PC title with no way to change controller config.
Is it a "Games for Windows" game? I never buy those for reasons like that - always shoddy console ports with no decent PC options.
PrimeTimeAction

Re: Universal Joystick Remapper (UJR)

07 Jan 2015, 00:16

I tried this but it did not work because as soon as i plug in the joystick, the game detects this.
Anyway I have given up. I think it will be easier to get used to the wrong buttons then trying to fix it.
Thanks alot for the help.
phorxs

Re: Universal Joystick Remapper (UJR)

02 Feb 2015, 08:32

I'm trying to use this to split the throttle and the rudder controls on a Ace-edge Joystick. Basically the throttle is mapped to a xbox 360 right trigger and the rudder is to the left trigger. where 0 would be rudder all the way to the left. 50% is rudder neutral and 100% is rudder to the right all on the left trigger. Throttle is the same thing just on the right trigger. is there a way to split the axis and tell it that the new axis is from 0 to 50 and the other axis is 50 to 100? I have been looking for a solution to this all night and this is the software that has come closest. I would very much appreciate some help on this.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

02 Feb 2015, 14:08

OK, lemme get this straight...

You wish to make the throttle use one axis and the rudder use another axis?

In the original product, the throttle controls right trigger and the rudder controls left?

AFAIK,
UJR is not capable of handling this, and cannot be modified to handle this.
You need something that reads the controller using "XInput".

UJR reads the stick using another method, which is not capable of reading triggers as individual axes - the way UJR reads the stick, both triggers appear as one axis centered in the middle.

If you open Windows Game Controllers and preview the axes, do you see an axis each for throttle and rudder?

In UJR, can you see one axis per trigger? (I guess not, else you would not be posting?).

Lexikos has written an XInput library for AHK which can be found here:
http://www.autohotkey.com/board/topic/3 ... oller-api/

That could certainly be used to read the stick such that you would get separate axes for each trigger.
You would then need to operate a virtual joystick according to the inputs - you can find my vJoy lib for AHK here: http://ahkscript.org/boards/viewtopic.php?f=6&t=5705
phorxs

Re: Universal Joystick Remapper (UJR)

02 Feb 2015, 22:25

Ok thanks for your input I will try and figure out xinput support.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

06 Feb 2015, 04:22

For all those UJR fans out there, today I have a rather juicy teaser of things to come...

I have been VERY hard at work lately working on the next generation of my macro system, which will merge together UJR, Fire Control and just about every other app I wrote into one plugin-based system.

Anyways, in order to be able to properly replace UJR, I need to break free from AHK's joystick system, as it only supports 6 axes, 1 POV hat and ?32 buttons?, which is not enough.

So I have had to resort to Windows API Dll Calls to write my own joystick input system for AHK using "HID".
HID is a system for USB that lets computers interpret devices without a driver - this is why you can plug in even a high-end stick without drivers and see something appear in the windows control panel preview.
Most USB devices that have buttons on them or axes / POVs / dials are HID devices.

So this potentially opens the door to using ANY USB DEVICE with this software - SpaceNavigators, Steel Battalion controllers, Head trackers etc, even uninstalling your Saitek or Thrustmaster software (or even mouse software) and solely using this system could be a possibility.

Anyway, today is a big day. Today is the first day that I successfully "decoded" all the "joystick capabilities" (ie I am able to tell, through code, how many buttons / axes each stick has). It's an important first step on the road to getting this system working. So here you go - my new system decoding a full-capability vJoy stick.

Image
Guest

Re: Universal Joystick Remapper (UJR)

15 Feb 2015, 12:33

Can you try and help me please... been fighting with your UJR program for 2 days.
What ever I try I get the message saying that I don't have the latest vJoy.. so can't get into the program at all.
I have tried uninstalling vJoy repeatedly and have tried using the vJoy_204_241214.exe and vJoy_205_080115 both say the same thing.

I'm using windows 8.1 - The vJoy driver is working and I can work with vJoy tester and see everything working ok. I just can't use UJR :cry:

Please help.
simonmaltby
Posts: 5
Joined: 15 Feb 2015, 12:34

Re: Universal Joystick Remapper (UJR)

15 Feb 2015, 12:36

Can you try and help me please... been fighting with your UJR program for 2 days.
What ever I try I get the message saying that I don't have the latest vJoy.. so can't get into the program at all.
I have tried uninstalling vJoy repeatedly and have tried using the vJoy_204_241214.exe and vJoy_205_080115 both say the same thing.

I'm using windows 8.1 - The vJoy driver is working and I can work with vJoy tester and see everything working ok. I just can't use UJR :cry:

Please help.
simonmaltby
Posts: 5
Joined: 15 Feb 2015, 12:34

Re: Universal Joystick Remapper (UJR)

15 Feb 2015, 12:39

Yes I have both folders and both contain a vJoyInterface.dll

Currently I have the December 2014 vJoy installed.
vJoyInterface.dll is dated 22/09/2014 in both x64 and x86 folders
The vJoy device driver is version 6.0.6000.16386 dated 08/Sep/2014
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

15 Feb 2015, 13:54

So when you start UJR, does it say "Failed to Load Interface DLL"?

If so, what folders did it look in? It should say like "Looking in C:\Program Files\vJoy\x86\ ..."
What version(s) did it try to load?
simonmaltby
Posts: 5
Joined: 15 Feb 2015, 12:34

Re: Universal Joystick Remapper (UJR)

15 Feb 2015, 13:58

No nothing like that.
I get a popup message box title "Error"
then the message reads...
" A vJoy install was found in c:\Program Files\vJoy\, but appears to be an old version. Please update vJoy to the latest version from....."
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR)

15 Feb 2015, 14:01

That error happens when it could not find the registry key.

Look in your registry under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E31F76F-74C3-47F1-9550-E041EEDC5FBB}_is1

Do you see a vJoy key?

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 43 guests