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

Post gaming related scripts
AzXeus15
Posts: 2
Joined: 01 Nov 2015, 08:27

map axis as buttons

01 Nov 2015, 08:30

Hi, could you please try to include an option to map an axis as a button (for example using 360 triggers as buttons)
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR) - v6.9 8th Oct 2015

01 Nov 2015, 11:36

360 triggers are a particularly problematic beast.
When reading them using normal AHK commands, the triggers read as one axis combined, so there is no way to tell the difference between neither trigger pressed, or both triggers pressed.
Go into Windows Game Controllers, preview the output of the XBox controller, and notice the behavior of the Z Axis. This is what UJR sees.
To do what you want, you would need Lexikos's XInput library.
I am, however, working towards a replacement for UJR that may support this, but I doubt it would make it into this incarnation of UJR.
AzXeus15
Posts: 2
Joined: 01 Nov 2015, 08:27

01 Nov 2015, 11:51

thanks for the quick reply, I know that about the triggers but i wanted it anyway, i also have a controller that has triggers which are separate axis but the problem is that not all games will allow this to be used as buttons
what i wanted was an easy was to do this in Dinput, i wasn't bothered about the Xinput
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

Re: Universal Joystick Remapper (UJR) - v6.9 8th Oct 2015

01 Nov 2015, 11:59

Well UJR doesn't support axis->button mapping I am afraid, and more than one script can't control one vJoy stick, so you cannot map an axis of a UJR stick to a button of a UJR stick.
The best you could do would be to write a script that reads vJoy stick 1 and maps it to vJoy stick 2, then bind the game to vJoy stick 2.
If all the inputs do not need to be coming from the same source (eg the game also supports keyboard input), then your options are way more varied.
Then you could just use an ahk script to remap the vJoy axis to a keyboard key.
TemplarK
Posts: 1
Joined: 04 Nov 2015, 15:41

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

04 Nov 2015, 15:44

Hi, i am having some issues that i dont know how to correct. I used ujr and it worked fine to begin, when I bound my sticks vjoy would outut on (input 4) and this was correct because i have 2sticks and pedals.

Now however vjoy is outputting on (input1) and its causing all sort of problems.

How do i tell ujr to tell vjoy to output vjoy on (input4)?

Thanks
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

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

04 Nov 2015, 19:00

What do you mean "input 4"?
When you used to bind it in games, they called it "Joystick 4"?

If so, that's a joystick id - vjoy automatically sets itself as joystick 1 - I dunno why it was 4 before.

If you need to change a joyid, you can use PJP's JoyIDs
http://theairtacticalassaultgroup.com/f ... hp?t=13009
Hotas
Posts: 12
Joined: 11 Nov 2015, 12:06

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

11 Nov 2015, 12:17

First want to say thanks for UJR, I was able to get it up and running very easily and almost perfectly.

I am having a problem with turning driving pedals into a rudder axis. I followed your instructions and the the pedals work as intended as a virtual rudder axis. However the brake pedal (left) is functioning like a button, showing either on or off (100/0) with only a minimal pedal movement in UJR and within games. In the Win 7 USB Game Controller properties, the brake pedal gauge is registering the travel correctly as an analog input.

The accelerator (right) is working correctly as an analog input within UJR, games and in the Win 7 properties menu.

Thanks in advance for any help.
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

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

11 Nov 2015, 13:57

Do you mean that it is only behaving this way during axis merging, or does it exhibit digital behaviour when you map it as a normal axis?

UJR uses plain old AHK commands to read axes, so if you have AHK installed, if you could try this code as a test, that would help work out what is going wrong.
Just change the numbers on the two lines at the start to match the numbers of the Stick / Axis in UJR

Code: Select all

#SingleInstance force
stick := 2		; Change stick to same ID that it appears as in UJR
axis := 1		; Change axis to same ID that it appears as in UJR

axis_list_ahk := ["X","Y","Z","R","U","V"]
str := stick "Joy" axis_list_ahk[axis]

Loop {
	tooltip % GetKeyState(str)
	Sleep 100
}
return

Esc:
	ExitApp
Hotas
Posts: 12
Joined: 11 Nov 2015, 12:06

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

11 Nov 2015, 14:15

The pedal is acting this way even when I map it to a normal axis.

I do not have AHK (and don't know anything about programming) but am willing to try.

I will download AHK and try your test.
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

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

11 Nov 2015, 14:22

install ahk
copy the text of the code to the clipboard
create a new a text file, call it "something.ahk" instead of "something.txt". The icon should change to an H
paste the code above into the file
change the two numbers as directed above
save the file
double click the file, it should run.
When you move the pedal, a tooltip should appear with the current value for the axis
Hotas
Posts: 12
Joined: 11 Nov 2015, 12:06

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

11 Nov 2015, 14:26

Ok, I think I ran your script, my cursor is now showing a value of 49.999237. Not sure if that is what was intended or what you need.
Hotas
Posts: 12
Joined: 11 Nov 2015, 12:06

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

11 Nov 2015, 14:27

Sorry, I didn't press the pedal, the value is 100.0
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

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

11 Nov 2015, 14:39

what I am interested in is the range of numbers that you get from the pedal.
0 is one end of the scale, 100 is the other end, and 50 is the middle.
"Normal" axes would rest at 50 when you are not touching the stick.
Single-axis pedals normally sit at 0 or 100
if one of your pedals sits at 50 when not pressed, then that is most odd - why have a single-axis pedal that only uses half the axis???
Please confirm what values both of your pedals report for not pressed and fully pressed.
Hotas
Posts: 12
Joined: 11 Nov 2015, 12:06

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

11 Nov 2015, 14:42

Left brake pedal: 0 not pressed, 100 pressed. 100 for the whole range of travel
Right accelerator pedal: 100 not pressed. 0 fully depressed. Range 100 to zero during the pedal travel.
Hotas
Posts: 12
Joined: 11 Nov 2015, 12:06

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

11 Nov 2015, 14:46

To clarify, the tooltip just happens to show 49.999237 whenever the script is first run.
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

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

11 Nov 2015, 14:52

So UJR will be able to read the pedals OK, it will probably be a mis-configuration that is causing the problem.

You need to set it up so that the left pedal is on tab 1, and the slider sits at the right edge when the pedal is not pressed.
Then set the right pedal to be on tab 2, and make it so the slider sits at the left edge when the pedal is not pressed.

If that fails, try the other way around.
Basically, imagine if you had both sliders sitting next to each other, the slider for each should rest in the middle.
When you press the pedal on tab 1, the slider should move left. When you press the pedal on tab 2, the slider should move right.
Like this:

Code: Select all

|__Tab_1_Slider__| ^ |__Tab_2_Slider__|
                   |
Sliders for both pedals should rest in middle
Last edited by evilC on 11 Nov 2015, 15:01, edited 1 time in total.
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

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

11 Nov 2015, 14:55

Hotas wrote:To clarify, the tooltip just happens to show 49.999237 whenever the script is first run.
That is odd.
All the script does is read the value of the axis 10 times a second.
So at some point, AHK is seeing that axis as sitting at the mid-point.
How long does it read the value as ~50 ? Until you move a pedal?
Hotas
Posts: 12
Joined: 11 Nov 2015, 12:06

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

11 Nov 2015, 15:00

Ya, it only shows ~50 until a pedal press.
User avatar
evilC
Posts: 4766
Joined: 27 Feb 2014, 12:30

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

11 Nov 2015, 15:13

Then something is wrong. If each pedal reports either 0 or 100 when not pressed, then if you launch the script with nothing pressed, there should be no way that it would read 50 - it should read 0 or 100.
What make / model is it?

In UJR, the numbers in the "Physical" column for each axis are the same as what that script does.
What is UJR seeing for the pedals?

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 16 guests