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

Post gaming related scripts
jra64
Posts: 9
Joined: 15 Feb 2016, 19:39

Re: Universal Control Remapper (UCR) - v0.1.16 11th Jun 2017

21 Aug 2017, 06:47

@evilC Thanks for the quick reply! Took a while for me to set up all my controls but after a while, it worked! Well, kinda... There is a pretty large delay in between the button presses. Like I set L1 to press Square+Triangle and it doesn't press them at the same time at all which is the point shoulder button / macro for me.

If you have any ideas on what else can be done please let me know.

Thanks for reading.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.16 11th Jun 2017

21 Aug 2017, 08:41

In fact, it was only a couple of minutes work (Only 4 lines of code different from the normal ButtonToButton plugin), so I knocked you one up in my lunch break:

Save as Plugins\User\ButtonToButtons.ahk

Code: Select all

; All plugins must derive from the _Plugin class
class ButtonToButtons extends _UCR.Classes.Plugin {
	Type := "Remapper (Buttons To Button)"
	Description := "Remaps one button type input to two button type outputs"
	; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
	Init(){
		; Create the GUI
		Gui, Add, GroupBox, Center xm ym w170 h60 section, Input Button
		this.AddControl("InputButton", "IB1", 0, this.MyHkChangedState.Bind(this), "xs+5 ys+20")
		this.AddControl("ButtonPreview", "", 0, this.IOControls.IB1, "x+5 yp+5")
		;Gui, Add, Text, y+10, % "Remap"
		Gui, Add, GroupBox, Center x190 ym w170 h60 section, Output Button #1
		this.AddControl("OutputButton", "OB1", 0, "xs+5 ys+20")
		this.AddControl("ButtonPreview", "", 0, this.IOControls.OB1, "x+5 yp+5")
		
		Gui, Add, GroupBox, Center x370 ym w170 h60 section, Output Button #2
		this.AddControl("OutputButton", "OB2", 0, "xs+5 ys+20")
		this.AddControl("ButtonPreview", "", 0, this.IOControls.OB2, "x+5 yp+5")
		
		Gui, Add, GroupBox, Center x550 ym w100 h60 section, Settings
		this.AddControl("Checkbox", "Toggle", 0, "xs+10 yp+30", "Toggle mode")
	}
	
	; Called when the hotkey changes state (key is pressed or released)
	MyHkChangedState(e){
		;OutputDebug, % "UCR| Plugin" this.Name " changed state to: " (e ? "Down" : "Up")
		if (this.GuiControls.Toggle.Get()){
			; Toggle mode - Toggle the state of the output when the input goes down
			if (e){
				this.IOControls.OB1.Set(!this.IOControls.OB1.Get())
				this.IOControls.OB2.Set(!this.IOControls.OB2.Get())
			}
		} else {
			; Normal mode - Set the state of the output to match the state of the input
			this.IOControls.OB1.Set(e)
			this.IOControls.OB2.Set(e)
		}
	}
}

jra64
Posts: 9
Joined: 15 Feb 2016, 19:39

Re: Universal Control Remapper (UCR) - v0.1.16 11th Jun 2017

21 Aug 2017, 09:35

This is amazing thank you so much! I'm at work right now too so I can't wait to try it out when I get home :).
Last edited by jra64 on 21 Aug 2017, 09:40, edited 1 time in total.
jra64
Posts: 9
Joined: 15 Feb 2016, 19:39

Re: Universal Control Remapper (UCR) - v0.1.16 11th Jun 2017

21 Aug 2017, 09:41

I actually just edited my post cause I figured it out. Yeah I'll be selecting the plugin on the drop down menu.

Thanks again evilC I'll be trying it when I get home! I can't wait seriously!
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

21 Aug 2017, 14:24

0.1.17 released

Code: Select all

0.1.17 - 21st Aug 2017
= You can now properly bind Mouse Wheel
= "Profile Inherits from Parent" checkbox now correctly updates when switching profile
+ Scale added to AxisToMouse, as sensitivity is a curve
+ The PauseButton plugin now beeps when you pause / unpause
+ Titan One D-Pad now correctly set
+ Titan One PS3 controllers now support accelerometer
+ Titan One PS4 controllers now support gyros
jra64
Posts: 9
Joined: 15 Feb 2016, 19:39

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

21 Aug 2017, 16:30

I'm on my lunch break! I finally got a chance to test it and it does work but it doesn't consistently press them at the same time. Sometimes it does get the buttons at the same time (it got 6/10 just now so 60%), but sometimes it gets one input followed by the other shortly after. Because I'm playing a fighting game it requires a stricter timing. Any idea on why it might be slightly delaying them sometimes?

Even when I just try to push the buttons manually I can't get them at the same time? Is that a problem with vJoy or something?! If I use the PS4 directly on the game it works fine.

I have a gamebind set to 999999999999999999999999999999999999 I wonder if that might be a problem? I just wanted to be able to block off the raw inputs from the PS4 controller to the game completely...
Guest

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

30 Aug 2017, 13:39

I think the game I'm trying to use is detecting both inputs from keyboard and virtual gamepad at same time, I tried running UCR.exe as admin with no luck, I missed anything?
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

30 Aug 2017, 14:26

Barrie @ OneSwitch asked me for a profile switcher plugin that took an axis as an input.
I quickly whipped one up - anyone else fancy testing it out? I suppose it would probably be worth including as a core plugin.

Code: Select all

/*
Allows changing to one of two profiles using an axis as input.
*/
class ProfileSwitcherAxis extends _UCR.Classes.Plugin {
	Type := "Profile Switcher (Axis)"
	Description := "Changes to a named profile from Axis Input"
	Init(){
		Gui, Add, Text, y+20, % "Input Axis: "
		;this.AddControl("InputButton", "MyHk1", 0, this.MyHkChangedState.Bind(this), "x150 yp w200")
		this.AddControl("InputAxis", "MyHk1", 0, this.MyHkChangedState.Bind(this), "x170 yp-10 w200")
		this.AddControl("AxisPreview", "", 0, this.IOControls.MyHk1, "x+5 yp+5 w100", 50)
		
		Gui, Add, Text, % "x+10 yp-5", DeadZone
		this.AddControl("Edit", "Deadzone", 0, "xp+15 y+3 w25", "20")

		Gui, Add, Text, xm, % "Low Profile"
		this.AddControl("ProfileSelect", "ProfileL", 0, "x170 yp-2 w380", 0)
		
		; Button to test profile change
		Gui, Add, Button, x+5 yp-2 hwndhTestL, Test
		this.hTestL := hTestL
		fn := this.MyHkChangedState.Bind(this, 0)
		GuiControl +g, % this.hTestL, % fn
		
		Gui, Add, Text, xm, % "Center Profile"
		this.AddControl("ProfileSelect", "Profile0", 0, "x170 yp-2 w380", 0)		

		; Button to test profile change
		Gui, Add, Button, x+5 yp hwndhTest0, Test
		this.hTest0 := hTest0
		fn := this.MyHkChangedState.Bind(this, 50)
		GuiControl +g, % this.hTest0, % fn

		Gui, Add, Text, xm, % "High Profile"
		this.AddControl("ProfileSelect", "ProfileH", 0, "x170 yp-2 w380", 0)		
		
		; Button to test profile change
		Gui, Add, Button, x+5 yp hwndhTestH, Test
		this.hTestH := hTestH
		fn := this.MyHkChangedState.Bind(this, 100)
		GuiControl +g, % this.hTestH, % fn
	}

	; The hotkey was pressed to change profile
	MyHkChangedState(value){
		static current_state := 0
		value := UCR.Libraries.StickOps.AHKToInternal(value)
		
		dz := this.GuiControls.Deadzone.Get()
		if (dz){
			value := UCR.Libraries.StickOps.Deadzone(value, dz)
		}
		
		new_state := value < 0 ? "L" : (value > 0 ? "H" : 0)
		
		if (new_state != current_state){
			new_profile := this.GuiControls["Profile" new_state].Get()
			if (!UCR.ChangeProfile(new_profile)){
				SoundBeep, 300, 200
			}
			current_state := new_state
		}
		;OutputDebug % "UCR| value: " value ", new_state: " new_state
	}
	
	; In order to free memory when a plugin is closed, we must free references to this object
	OnClose(){
		GuiControl -g, % this.hTest0
		GuiControl -g, % this.hTestH
		GuiControl -g, % this.hTestL
		base.OnClose()
	}
		
}
Guest

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

30 Aug 2017, 15:11

evilC wrote:Did you select "Block" for the keyboard input? That will probably stop the game from being able to see the keyboard inputs change state
that should work, thanks, but what about mouse X and Y movement?
Benny89
Posts: 1
Joined: 31 Aug 2017, 06:23

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

31 Aug 2017, 07:41

Hi,

I have downloaded UCR (Windows 10) and wanted to make input from keyboard emulate Xbox One Controller output. However after I plug in via USB cable X ONE controller to PC I don't see in UCR in menu OUtput options for Xbox buttons (they are greyed out). Only thing I have are Xbox Stics and Titan One.

Any advice what to do so I can choose Xbox buttons? My controller alone works wired and wireless with all games.
jra64
Posts: 9
Joined: 15 Feb 2016, 19:39

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

01 Sep 2017, 23:55

@evilC Could you maybe point me in the right direction on my previous post? I still haven't had any luck on finding why these inputs might be delayed. I'm thinking it has something to do with vJoy...
Raptor_67
Posts: 4
Joined: 03 Sep 2017, 08:22

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

03 Sep 2017, 09:15

Noob question here.
2 days ago I downloaded and installed vJoy and UCR
I'm trying to setup 2 TM Warthogs (1 modified left handed one and a standard one) for Star Citizen.
I also have a set of peddles and 2 X MFD's
Discovered the SC 50 key limit (the hard way), but things are more manageable now I'm not trying to put everything into 1 Virtual Joystick.
My Virtual Joystick has 7 Axes and 50 buttons.
The main thing I have not quite worked out yet is a SHIFT function.

So I have the following in my Profiles...
Profile Switcher Hotkey "Stick 2 Button 4"
Switch to this profile on press "StarCitizen-Shift" !** This is a copy of the main profile with a few buttons remapped so they are effectively shifted.
Switch to this profile on release "Star Citizen" !** This is the main profile.
I have this switcher plugin the same in both profiles. The "StarCitizen-Shift" profile is not a child of the "StarCitizen" profile. "Profile inherits plugins from parent" is not checked.
Problem is, the profile switcher acts more like a toggle.
When I press "Stick 2 Button 4" the profile is swapped, when I release "Stick 2 Button 4", nothing happens.
when I press it again, nothing happens, when I release if for the second time, it switches back.

Any ideas as to what I'm doing wrong?

Thanks in Advance
Last edited by Raptor_67 on 03 Sep 2017, 20:59, edited 1 time in total.
Raptor_67
Posts: 4
Joined: 03 Sep 2017, 08:22

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

03 Sep 2017, 20:51

While I'm here, is there a way to stop a game (in this case Star Citizen) from seeing the physical controllers?

EDIT: Found White Knight here. Will try that out tonight.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

12 Sep 2017, 13:25

@Raptor
Shift profiles should be a child of the parent profile and they should have "inherit from parent" checked.
The profile switcher plugin should be in the parent profile.

Ideally you need two child profiles - a "Default" one and a "Shifted" one.
Anything that changes mapping while shifted should be mapped in both the "Default" and "Shifted" child profiles.
Anything that is common to both default and shifted state should be in the parent profile.

Hope this helps
Blaze53

Re: Universal Control Remapper (UCR) - v0.1.17 21st Aug 2017

14 Sep 2017, 04:45

So I'm highly annoyed. I've been using UJR (since I didn't know about UCR at all) and for no apparent reason I'm suddenly getting an illegal character in variable error. And it was working just fine earlier. A fresh copy of the .ahk and .exe don't seem to do a thing... and I find that there's an update to it called UCR. Hurray! Only the download link you've given us is invalid.

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 33 guests