Welcome, Guest
Username: Password: Remember me

TOPIC: UJR - Universal Joystick Remapper (AHK GUI script)

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 9 months ago #489

  • evilC
  • evilC's Avatar
  • Offline
A feeder application that lets you control the virtual stick with physical stick(s) - plus support for deadzones and lots of other goodness.

Please see the main release thread here.

Last Edit: 3 years 10 months ago by evilC.
The administrator has disabled public write access.
The following user(s) said Thank You: TheFatebacked

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 9 months ago #491

  • TheFatebacked
  • TheFatebacked's Avatar
  • Offline
Thanks for putting this together evilC, its working like a charm!

I'm made a modification that just ups the count to 32 buttons (you can reconfigure the vJoy to 32 buttons as described here). Since that made the GUI a bit big to compensate for all the button mapping options, I added some minimize-to-taskbar code as well (personal preference). Unfortunately I can't seem to figure out how to attach a file.

evilC: I'm assuming since we're using a ppjoy mapping method we have no way of bringing in the POV hat? Sorry if that's a silly question/statement, I have no previous experience w/ vJoy or AutoHotkey, I just went monkey-see-monkey-do from your 8 button example.
Last Edit: 4 years 9 months ago by TheFatebacked.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #516

  • evilC
  • evilC's Avatar
  • Offline
Version 3.0 out - see original post for changes (LOTS since last version posted here)

TheFatebacked - Hats are possible, unfortunately I think AutoHotkey can only detects one hat. Whatever, I only have a single hat stick, so I have not really tackled hats yet as I kind of wanted to know how multiple hats could be handled before writing hat support.

If you have a multi-hat stick and are willing to do some tests, please drop me a line.
Last Edit: 4 years 8 months ago by evilC.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #523

  • commanderwill
  • commanderwill's Avatar
  • Offline
I've been testing this out, it's awesome!
You mentioned you were looking for people with multi-hat joysticks to test the pov settings, does multiple joysticks with POV work for you testing or just single joysticks with multiple POV's?

Also, I was wondering, would it be possible to add in sensitivity settings for individual axis and if so is it already planned?
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #524

  • evilC
  • evilC's Avatar
  • Offline
I have no multi-hat sticks, so I am unable to do any tests. From what i understand, ahk has no concept of multi-hat sticks so custom dll calls would be needed.

Regarding sensitivity - that is a tough one because at the stick level there is no such thing as sensitivity - a stick simply reports where it is at. If you apply a flat divider - eg divide stick magnitude by 2, you would never reach 100%, only 50%
The only way to do this would be with a varying scale such that, for example, the stick is half as sensitive near the middle but twice as sensitive at the ends of the scale.
A game may implement sensitivity, but that is affecting how the game interprets thestck values, not how the stick values are reported.

If someone can suggest options, I am all ears
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #525

  • Shaul
  • Shaul's Avatar
  • Offline
  • The Author
I totally agree with evilC
A joystick reports the position of the stick in the range of -100% to +100%. It is the role of the target application (=game) to interpret the data correctly. It may map absolute low values (say -20% to +20%) into a smaller range (say -10% to +10%) thus being less sensitive around the centre. But it will have to compensate for that by making the end of the trip more sensitive. This is done in flight simulators and is (incorrectly) called "exponent".
If you cannot get your target application to do this sensitivity calibration you can do it on the other end of the data path - by feeding AHK with cooked data.
I'm not sure what your input is, so I cannot say much about it.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #526

  • evilC
  • evilC's Avatar
  • Offline
Saying that, I *do* have plans to let you tweak with axes, although the objective is slightly different - I want to let people move the center of the stick, so for example, if your throttle has a "detent" (notch) at 33%, I want to allow people to set that as the middle, so if you want to use forwards from the notch as forwards, and backwards from the notch as reverse, you can remap the scales to achieve that.
So, if or when I get around to doing that, I will see if I can do anything to facilitate changes similar to what you describe. I also know of one guy who has limited leg movement and would like to "double" the sensitivity of his pedals (So he only has to move them half way to get full deflection) so I am already bearing needs like this in mind.
So in short - "Less sensitive" is easy - but you would only ever be able to get to 50%, and "More sensitive" is also easy if you only want to have to move the stick half way to acheive full deflection.
Changing sensitivity whilst preserving the whole range of motion is tricky, especially with the UI limitations of AutoHotkey.
The administrator has disabled public write access.
The following user(s) said Thank You: commanderwill

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #527

  • commanderwill
  • commanderwill's Avatar
  • Offline
That's great to know, I had no idea til now that sensitivity is mostly a on the game's side of things, so that's great that you were able to explain that. I love the progress you've made so far, keep up the great work!
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #544

  • evilC
  • evilC's Avatar
  • Offline
3.1 now up with a sensitivity option.

I used the equation from here: www.chiefdelphi.com/media/papers/2421
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #545

  • commanderwill
  • commanderwill's Avatar
  • Offline
That's awesome! Thanks for the hard work!
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 8 months ago #546

  • Shaul
  • Shaul's Avatar
  • Offline
  • The Author
evilC, you are doing incredible work. You are adding great value to vJoy!
I plan to add Force feedback (FFC) in the future. Will this be of any use for you?
If so I will invite you to co-operate when time is ripe.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 7 months ago #547

  • evilC
  • evilC's Avatar
  • Offline
Thanks for your kind words Shaul.

I have a FF wheel (Logitech G27), but not a stick.
If vJoy works with that in the same way, I think I could maybe write something in - is FF associated with an axis? If so, I suppose I could just re-route any FF intended for virtual axis to the physical axis?
However, AFAIK AHK does not support FF - I think it could be done, but this would require DLL calls to XInput - something I know nothing about.

Of more concern to me is HAT switch support. By default, AHK has no support for multi-hat sticks (Only a single hat), but it should be possible to read the raw data using DLL calls, but as I mentioned before, this is something I know nothing about and I also do not have a multi-hat stick to do my own tests. I wondered if you maybe had some knowledge or knew someone who might be able to help in this regard.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 7 months ago #548

  • Shaul
  • Shaul's Avatar
  • Offline
  • The Author
I did not work on FFB for ages, so I hope my reply is not total rubbish:
I have a FF wheel (Logitech G27), but not a stick.
This is not important. Wheels and sticks are very similar.
is FF associated with an axis?
I think so. Please take a look at this old document. However, most devices support only a tiny portion of the wealth of options the spec offers.
Now, I think I need to explain what vJoy is related to FFB:
  • The usual flow of information is app(source)->feeder->vJoy->app(target)/li]
  • The FFB flow is in the opposite direction: Target app (simulator) sends DirectInput (DI) an FFB effect. DI informs vJoy. vJoy inform feeder. feeder informs source (AHK?)
  • vJoy reacts only to effects it recognises. there's no way vJoy will recognise all possible effects
I wondered if you maybe had some knowledge or knew someone who might be able to help in this regard.
No. Sorry...
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 7 months ago #549

  • evilC
  • evilC's Avatar
  • Offline
OK, surely there would be no point making adjustments to the FF, it would be way too complicated.

Maybe a better solution would be to build an app that redirects FF to the physical stick(s) of your choice.

Not trying to avoid doing the job but it seems to me that it is a bit of a separate concern to remapping axes.

Besides, in general FF sucks. The only case I have ever come across that it serves any purpose is for steering wheels so you can feel the way the car is behaving.
Other than that, IMHO FF makes games harder.

Also, regarding UJR: I am getting more and more inclined to make UJR a C app. AHK just isn't cutting it for more complex coding - it's syntax can be ambiguous at times (eg sometimes myvar is a variable, sometimes you need to use %myvar%) and it is driving me nuts.

I have never written windows apps or device drivers before and it is always something I wanted to dip my toe into, and the more I think about it the more this seems to be the ideal first project.

Any recommendations on which flavour of C would be best? Any advice on free sources of info to get me going?
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 7 months ago #550

  • Shaul
  • Shaul's Avatar
  • Offline
  • The Author
The only case I have ever come across that it serves any purpose is for steering wheels so you can feel the way the car is behaving.
Same here.
I am getting more and more inclined to make UJR a C app.
AHK seems to be a nice option for relatively simple tasks. If you have to write complex code to use it then it is probably time to write code that is similarly complex but avoids redundant software layer. So it is perhaps time you write a feeder that communicates directly with vJoy interface.
I have never written windows apps or device drivers
These are two totally different things.
Writing a driver is very complicated and very dangerous. You must also write an installer which is not trivial. Drivers for x86 are not compatible with x64 and vice versa. And developing a driver requires at least two machines (Development and debug target) - drop it.
Writing a Windows app is much simpler. The available free development environments are good and compatibility is not an issue. There are many example projects out there and you can write in C/C++ or C#/VB
Any recommendations on which flavour of C would be best? Any advice on free sources of info to get me going?
Here are my 2c worth of advice. Other people will have different opinions.
Development Environment: I use MS Visual Studio 2008 Express which is free. You might want to try the latest version which is Visual Studio 2012 Express. This is a solid IDE that supports C/C++, C#/VisualBasic compiler/linkers. It also comes with code templates so you can have your first Windows application (Hello World) within 5 minutes.
I prefer C++ as it does not require installation of .NET on the target machine. C#/VisualBasic are more powerful but are managed. The resulting application is identical.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 7 months ago #551

  • evilC
  • evilC's Avatar
  • Offline
What about the GUI capabilities of C++ vs say C#?
I anticipate that I would want quite rich GUI capabilities (eg a graph to represent X/Y axes, dynamic GUI (Adding items to a scrolling sub-pane) etc etc.

And having slept on it, I think I may have changed my mind. Surely if you use UJR to invert an axis, you would also want to invert the FF going to that axis?

How about maybe I start UJR as a C++ app and we collaborate? I anticipate I may need a bit of hand-holding at the start, but once I get the hang of it, I should be able to replicate the current functionality of UJR pretty easily, and then we could maybe collaborate again on adding FF support?

We then bundle UJR with vJoystick, which would mean that the vast majority of joystick users would have a use for vJoystick, rather than just coders?
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 7 months ago #552

  • Shaul
  • Shaul's Avatar
  • Offline
  • The Author
What about the GUI capabilities of C++ vs say C#?
C++ does not have any GUI capabilities. You have to call some graphic library. There are plenty of good 3rd party libraries (GTK+, QT) but the problem with most of them is that you have to re-distribute a considerable number of DLL files.
I recommend sticking to one of MS libraries that are widespread and well documented - Windows runtime library, MFC, GDI+ (obsolete) or DirectX (Direct2D or Direct3D).
C# is more GUI oriented but at the end of the day it probably call the same libraries.
I anticipate that I would want quite rich GUI capabilities (eg a graph to represent X/Y axes, dynamic GUI (Adding items to a scrolling sub-pane)
Graph will probably be most easily created by Direct2D. DirectX SDK (free) comes with a huge list of example code.
Adding items: This is the one of the most basic feature one of the list controls. Controls are predefined elements of Windows. They consist of Buttons, Checkboxes, Tree views etc
you would also want to invert the FF going to that axis
I’m sure what you mean. FFB usually vibrate your stick or make it tougher. How do you invert vibration?
How about maybe I start UJR as a C++ app and we collaborate?
Sure. Please remember that both UJR & FFB are not in my focus right now - so you might need patients. I will be happy to direct you but most of the code will be written by you. We will lated merge it into vJoy installation.

I will PM you with my direct Gmail
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 7 months ago #553

  • evilC
  • evilC's Avatar
  • Offline
"I’m sure what you mean. FFB usually vibrate your stick or make it tougher. How do you invert vibration?"
On my FF steering wheel there is certainly way more than vibration.
FF is totally capable of fully operating a wheel - in a racing game, when you drift, the wheel will be pulled towards the direction of travel.
In fact, a FF wheel does not by default have centering - the centering is provided by the forwards motion of the car pulling the wheel towards center. This is modeled in FF.
Also, in FF racing games, if you go over a rut in the ground or something, the wheels follow the rut and FF also models this by turning the wheel in the direction of the rut.

In fact, with a G27, if you open the test panel and hit the buttons, it does some demo effects - many of these turn the wheel fully in one or both directions. The "skid" one and a "rocking boat" one spring to mind here.
Last Edit: 4 years 7 months ago by evilC.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 5 months ago #581

  • evilC
  • evilC's Avatar
  • Offline
Version 3.2 released, you can now remap the 1st hat switch.
If anyone can supply the code to read extra hat switches via dllcall or something, I will add the extra ones in.
The administrator has disabled public write access.

UJR - Universal Joystick Remapper (AHK GUI script) 4 years 5 months ago #600

  • isamu
  • isamu's Avatar
  • Offline
evilC wrote:
Thanks for your kind words Shaul.

I have a FF wheel (Logitech G27), but not a stick.
If vJoy works with that in the same way, I think I could maybe write something in - is FF associated with an axis? If so, I suppose I could just re-route any FF intended for virtual axis to the physical axis?
However, AFAIK AHK does not support FF - I think it could be done, but this would require DLL calls to XInput - something I know nothing about.

Hello EvilC. As someone who has been a fan of driving instruments on the PC(ie FFB STEERING WHEELS, PEDALS, SHIFTERS, ETC) and is a huge fan of all things force feedback, I am extremely excited and intrigued by this conversation. The program you've developed...UJR....appears to be extremely useful. This application sounds very similar to another old and discontinued utility called "Frank N Stick":

www.franknstik.com/index.php?page_id=1

Are you familiar with it? I have been using it on and off for many years and just started using it heavily again recently. The only feature it's missing is the ability to adjust the sensitivity of the virtual axis. I see this is something you've implemented not too long ago, but I'm curious....does UJR allow you adjust the sensitivity of the axis for *EACH* custom profile you create? Does UJR even support custom profiles?

If so:

..then let's say I create a profile called Need for speed, and proceed to calibrate my steering wheel giving it a virtual rotation of 180 degrees. Then I create another custom profile called Race Driver GRID and proceed to calibrate my wheel at 270 degrees. Does this mean that the analog sensitivity settings from each profile will carry over to the virtual joysick axis in vJoy, and will switch and change depending on which custom profile I select?

Please let me know, because this is something that cannot be done in Frank N Stick and I would VERY much love to have this option in UJR.

On another note, regarding the force feedback issue, you mentioned a possible solution of re-routing any FFB intended for vJoy to the physical axis of our steering wheels. This is a *PHENOMENAL* Idea! Do you think you could implement this in URJ soon?

EvilC I use several emulators to play old arcade racing games but some of them have very unusual or funky controller support, so these options would be a Godsend!

Finally, your last post was about two weeks ago, but the discussion between you and Shaul happened over two months ago. Has there been any progress or changes to UJR since then? In particular, did you decide to re-write the app in C++ or...?

Anyway please let know. I am very intrigued by this utility and would be grateful if you could address the questions I raised above. Thanks :)
Last Edit: 4 years 5 months ago by isamu.
The administrator has disabled public write access.
Time to create page: 1.700 seconds
Powered by Kunena Forum