Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

Post gaming related scripts
Special-T
Posts: 6
Joined: 20 Jul 2016, 09:08

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

20 Jul 2016, 10:21

Thank you for the quick reply. Changing Vjoy to continuous fixed the problem.

I thought the D-Pad was considered a 4 way directional vs continuous although I may be misunderstanding the difference between continuous and 4-way.

One additional question comes to mind though. UJR allowed multiple instances of the program to run at the same time so if I wanted to map two or three controllers I would just have two or three instances of UJR up. I guess this is no longer necessary with UCR because I would just map all devices to the same profile correct? I tested this and it seems to work but just wanted to make sure I wasn't misunderstanding anything.
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

20 Jul 2016, 14:13

Regarding the shortcut to change profile request - this is a bit of a tricky one thinking about it.
A shortcut launches something - if you run a shortcut to UCR with a command-line switch whilst UCR is running, it will just try to launch a new instance of UCR. Because of the way that UCR is written, this would probably work, but it would kill the current UCR instance and restart UCR.
What may be more desirable would be to use a ProfileSwitcher plugin and configure the hotkey to some key combination that would never normally be used (Like Ctrl+Alt+Shift+Win+F12) and then create an AHK script that sends these keys and use that as the "shortcut". Then, when you click on the shortcut, it sends the key sequence, which UCR sees and changes profile.
This does not currently work - there seems to be a nuance of AHK which I was not aware of - if the receiving script has a mapping to an up event (Like all UCR hotkeys do), then it does not see the sent key for some reason. I am currently looking into why this is.
Special-T
Posts: 6
Joined: 20 Jul 2016, 09:08

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

20 Jul 2016, 14:33

Thank you for clarifying. I appreciate all the information you've provided.
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

20 Jul 2016, 14:48

No problem.
Please do feel free to make suggestions for disabled / impaired users - I already collaborate with the charity OneSwitch to implement functionality into UCR to enable people who can only operate one or two buttons to play games, so stuff like this is not niche as far as UCR is concerned.
zaelu
Posts: 2
Joined: 20 Jul 2016, 06:20

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

21 Jul 2016, 14:01

evilC wrote:Not sure what "mode 2" and "mode 3" is. Can you enlighten?
Thanks for your reply.

Logitech G940 HOTAS has a mode switcher much like any Saitek X52 etc HOTAS. In mode 1 all buttons are direct input joystick buttons. In mode 2 and 3 they are the same buttons. However, you can use the software from Logitech to make the buttons in mode 2 or 3 (as a matter of fact you can do also on mode 1) to have different function and you can map keyboard inputs, simple or complex. But no direct input joystick buttons different than the first set from Mode 1.

I would like to have simply more Joystick buttons. Since a joystick has a limitation of 32 buttons I thought that using one of your software would allow me to do that and map the buttons from mode 2 and 3 to a virtual joystick. But the buttons appear the same in all 3 modes although the Logitech software is able to "understand" that buttons are pressed while in different mode (since it can map them to keyboard presses etc).
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

21 Jul 2016, 14:25

Joysticks are not limited to 32 buttons, they can have 128. Your saitek software may only handle 32 buttons, but that is a limitation of it, not joysticks in general.
However, UCR is limited to 32 buttons on the input side (Because of a limitation of AHK), but it can output 128 (As vJoy sticks can have 128 buttons)

UCR can only see the joystick as it is seen by the joystick preview window in the control panel, so if your stick does not report differently when in a different mode, UCR will obviously not see it any differently.
Why not just map the buttons in mode 2/3 to different functions, then remap those in UCR?

ie use the saitek software to set the trigger be button 1 in mode 1, F2 in mode 2 and F3 in mode 3
Then map UCR to button 1, F2 or F3

If the saitek software supports mapping things to F13 - F24, then that would be a good choice, as these keys are not present on most keyboards, so won't clash with anything.

You can also create "shift states" in UCR - eg you could make it so that when you hold button 2, all other buttons have different functions. Not the same as a switch, but would be more usable if cannot operate the switch without taking your hand off the stick.
Special-T
Posts: 6
Joined: 20 Jul 2016, 09:08

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

21 Jul 2016, 14:53

evilC wrote:No problem.
Please do feel free to make suggestions for disabled / impaired users - I already collaborate with the charity OneSwitch to implement functionality into UCR to enable people who can only operate one or two buttons to play games, so stuff like this is not niche as far as UCR is concerned.
That was really nice of you to do! I'm sure the people affected by your contribution to OneSwitch really appreciated your efforts!

I can't think of any other suggestions for disabled users at the moment, but I'll post back here if I do. Thanks again for your help!
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

24 Jul 2016, 11:23

New Release - 0.0.15

This one is mainly aimed at development of UCR and plugins.
I have switched to using AHK Studio as the editor for UCR.
Benefits that AHK Studio brings:
  • All classes can now be split out into separate files
    This was possible using Scite, but breakpoints in included files would only fire if you placed the breakpoint after starting debugging.
  • Plugins now more easily debuggable for the same reason as above.
  • Opening UCR.ahk in Studio also loads all associated files, as if UCR were a "project".
  • Studio is much more feature-rich in terms of programmer aids. Smart text input, easily find functions and class definitions etc.
In addition, there have been some bug fixes and enhancements, plus a new plugin.

Changelog:

Code: Select all

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

0.0.15 - 24th July 2016
! All ProfileSwitcher plugins will no longer be bound to a profile.
  You are advised to delete and re-add the plugin.
+ Dialogs to choose name of new Profile / Plugin now appear in the center of the UCR GUI.
+ A new custom GuiControl - the ProfileSelect is now available for Plugin Authors to use.
  This allows you to provide a guicontrol for users to choose a profile.
+ There is now a Text-To-Speech library provided in UCR.Libraries.TTS
+ Added Profile Speaker plugin.
  This can be used to speak something when a profile becomes active.
+ The OneSwitch Pulse plugin now makes a beep on toggle on/off.
+ The OneSwitch Pulse plugin now has a "Timeout Warning" setting.
= The recommended development environment for UCR is now AHK Studio
  Debugging of UCR and it's plugins is now much simpler.
  See the UCR wiki for info on debugging plugins.
  The code is now also split out into one file per class, so should be easier to work with.
= When you enter Bind Mode, the OnInActive() method is now called on all active plugins.
  All plugins should cease all activity on OnInActive() and resume on OnActive()
= The code of the ProfileSwitcher plugin is now vastly simplified.
  Most of it's code was moved into the ProfileSelect GuiControl.
Special-T
Posts: 6
Joined: 20 Jul 2016, 09:08

Re: Universal Control Remapper (UCR) - v0.0.15 24th July 2016 - AHK Studio!

25 Jul 2016, 08:05

Thank you for the update. It's greatly appreciated.

I don't see an option to start UCR at boot time so I created a bat file I was going to launch on start up. It works but not the way it's supposed too.

Batch File:

Code: Select all

cd "C:\Controllers\UCR"
start /min "" "UCR.exe"
Exit
The batch files runs and the cmd window automatically closes, however the program doesn't start minimized for some reason. Do you have any suggestions or thoughts on why it wouldn't start minimized?

Questions about UCR:
1. UCR typically takes 5 - 15 seconds to load. If I add more profiles it seems to increase the start up time. Will the boot time continue to increase each time I add additional profiles?
2. Is there any way I can speed up the boot time of UCR?

Suggestions for UCR:
- Add option to start UCR at boot time
- Add option to start UCR auto minimized
- Add option to not display the UCR in the Taskbar area and instead place it in the System Tray (notification) area
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.15 24th July 2016 - AHK Studio!

25 Jul 2016, 13:04

My guess is that when autohotkey starts running, there is no GUI, so there is nothing to minimize.
What may work better would be to use an AHK script as the shortcut, and have the AHK script launch UCR using Run and get it's PID.
Then minimize that pid.
Like so:

Code: Select all

#SingleInstance force
Run, UCR.exe,,,pid
While (!WinExist("ahk_pid " pid)){
	Sleep 10
}
Sleep 1000
WinMinimize, ahk_pid %pid%
"Will the boot time continue to increase each time I add additional profiles?" Currently, yes. This may change in the future, but it would take quite some work to implement this, as I would have to work out some way to dynamically initialize profiles as you switch to them. This already happens to a certain degree (The threads that handle input detection for each profile are started and stopped dynamically as you change profile), but making it so that boot time is nothing to do with number of profiles present would take another fairly major change.
UCR is still fairly un-optimized, this may improve when I do an optimization pass, though I am not sure yet when I am going to do this.

- Add option to start UCR at boot time
Place a shortcut to UCR (or a shortcut to the above script) in the startup menu (Type shell:startup into windows explorer, drag shortcut there)

- Add option to start UCR auto minimized
Will consider adding this as an option, but for now, use the script above.

- Add option to not display the UCR in the Taskbar area and instead place it in the System Tray (notification) area
Will add this feature when I put the UCR menu in. At the moment, there is no menu bar in UCR.
Special-T
Posts: 6
Joined: 20 Jul 2016, 09:08

Re: Universal Control Remapper (UCR) - v0.0.15 24th July 2016 - AHK Studio!

25 Jul 2016, 15:05

Thank you. I just adjusted Sleep 1000 to Sleep 3000 and it worked perfectly.
zaelu
Posts: 2
Joined: 20 Jul 2016, 06:20

Re: Universal Control Remapper (UCR) - v0.0.14 19th June 2016 - Profile Inheriting!

26 Jul 2016, 00:35

evilC wrote:Joysticks are not limited to 32 buttons, they can have 128. Your saitek software may only handle 32 buttons, but that is a limitation of it, not joysticks in general.
However, UCR is limited to 32 buttons on the input side (Because of a limitation of AHK), but it can output 128 (As vJoy sticks can have 128 buttons)
I only need 20 or so so there is no problem for me.
evilC wrote:UCR can only see the joystick as it is seen by the joystick preview window in the control panel, so if your stick does not report differently when in a different mode, UCR will obviously not see it any differently.
Why not just map the buttons in mode 2/3 to different functions, then remap those in UCR?
It seems that Logitech driver can "sense" that the mode button is in 2 or 3 and uses that as a modifier of some sort. UCR is unable to do that?

This is how it looks physically.

Image
evilC wrote: ie use the saitek software to set the trigger be button 1 in mode 1, F2 in mode 2 and F3 in mode 3
Then map UCR to button 1, F2 or F3
The F1 F2 F3... F12 are used extensively in all in the games I play, alone or in combinations with Ctrl and Alt etc so it is not much help, that's why I would like new simple direct input joystick buttons.
evilC wrote: If the saitek software supports mapping things to F13 - F24, then that would be a good choice, as these keys are not present on most keyboards, so won't clash with anything.
The Logitech software doesn't have ability to pick keys from a list it only "listen" to user presses on keyboard and doesn't "sense" Shift+F1 etc as F13 F14... F24. If I could have a virtual keyboard that could "press" those keys it would be great maybe.
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.15 24th July 2016 - AHK Studio!

26 Jul 2016, 03:28

a::F24
That will send F24 when you hit A. However the logitech software may still see A go down, so you could do something like:

Code: Select all

a::
   sleep 2000
   Send {F24}
The mode switch may be detectable via other applications, but would probably require accessing the stick directly via HID (Ie reading it via USB as a "Human Interface Device", not via the joystick functions in AHK).
This is far from a trivial task though.
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.15 24th July 2016 - AHK Studio!

12 Aug 2016, 14:15

For those of you that use the Mouse To Joystick plugin, I have just pushed a major fix for it to the Github repo which should address the flickering issues.

Will likely make a release on Sunday, but if you want it now, you can just grab the code from Github and drop in the UCR.exe from the last release.
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.15 24th July 2016 - AHK Studio!

14 Aug 2016, 11:20

New version released.

I made a lot of fixes and changes to back-end code, so please report anything that broke.

The ButtonToButton plugin now has a toggle option.
The MouseToJoy plugin is now a lot better in "Absolute" mode.
There are numerous improvements for the OneSwitch plugins (For disabled users), but more work needs doing here.

Code: Select all

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

0.0.16 - 14th Aug 2016
+ The ButtonToButton plugin now has a Toggle mode
+ MouseToJoy plugin enhancements:
  Added Scale Factor to Absolute mode.
  Plugin can now be configured to only take input from a specific mouse.
  You can now use multiple MouseToJoy plugins if you have more than one pointing device.
+ Added "HoldButton" functionality to OneSwitch Pulse plugin.
= InputActivity subscriptions no longer fire if the plugin is not active.
  This only really affects OneSwitch Pulse or any custom plugins using InputActivity.
= Fixed bug that occurred when changing an InputButton plugin from button to hat:
  The old binding was remaining active, this is now fixed.
= Fixed bug that occurred when changing an InputButton from keyboard to vJoy:
  The vJoy selection UI would change selection of various elements in odd ways.
= A bunch of behind-the-scenes changes and fixes.
  Please let me know if stuff that used to work now doesn't.
= MouseToJoy plugin fixes:
  Fixed numerous bugs which made Absolute mode center the stick way too much.
  The Timeout value for Absolute mode now works.

Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Universal Control Remapper (UCR) - v0.0.16 14th Aug 2016 - MouseToJoy fixes, Toggle mode for ButtonToButton plugin!

29 Aug 2016, 06:54

My mouse2joystick script relies on your CvJoyInterface, I ran it (my script) today, haven't thouched it in a couple of weeks, and today it just crashed and exited. I narrowed it down to crashing here:

Code: Select all

initCvJoyInterface:
	; Copied from joytest.ahk, from CvJoyInterface by evilC
	vJoyInterface := new CvJoyInterface()
	; Was vJoy installed and the DLL Loaded?
	if (!vJoyInterface.vJoyEnabled()){
		Msgbox,error
		ExitApp
	}
	global vstick := vJoyInterface.Devices[1]
There was no error message, it crached before that.
Re-installing vJoy solved it and it is working now. The only thing I can think of is that I have tried some joystick plugin in UCR, since last time I ran my script, I wonder if it could have caused some conflict. Is there a better way to "initalise" the interface than I do above, do I need to do something when exiting my script so it doesn't mess with other scripts running the interface. Do you know anything else that could cause this?

Cheers.

Edit: Clarification.
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.0.16 14th Aug 2016 - MouseToJoy fixes, Toggle mode for ButtonToButton plugin!

29 Aug 2016, 07:12

So I guess maybe it didn't find any vJoy devices?

You should be able to run multiple instances of a vJoy feeder and have each one control a vJoy stick. The only rule is that once a feeder has "acquired" a given vJoy stick, no other feeder can control that stick until it is "relinquished".

There could conceivably be an issue with my code failing to relinquish a stick when it exits, you could check this by using the demo feeder that comes with vJoy and see if it can see and control the vJoy stick that you wish to control - it is just another feeder, so it follows the same rules.

Please do let me know if you see any issues with UCR or CvJoyInterface failing to relinquish sticks.

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 36 guests