Are you talking about a custom plugin? I can't think of anything in UCR at the moment that sends a sequence.
With a custom plugin, you could add an InputButton for "Stop Sequence", then have the down event for the Stop Sequence hotkey set a class property that the code going through the sequence checks for.
Feel free to post code and I will see if I can help.
Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
tnx for answer, u are right i am talking about custom plugin, here is my plugin for example, how can i add "Stop Sequence" button ?
Code: Select all
class string4 extends _Plugin {
Type := "string4"
Description := "Your description here"
; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
Init(){
; Create the GUI
; Add a hotkey, and give it the name "MyHk1". All hotkey objects can be accessed via this.InputButtons[name]
; Have it call MyHkChangedState when it changes state.
this.AddInputButton("IB1", 0, this.MyHkChangedState.Bind(this), "xm ym w200")
; Add an Output, and give it the name "MyOp1". All output objects can be accessed via this.OutputButtons[name]
this.AddOutputButton("OB1", 0, "xm yp+25 w200")
this.AddOutputButton("OB2", 0, "xm yp+25 w200")
this.AddOutputButton("OB3", 0, "xm yp+25 w200")
this.AddOutputButton("OB4", 0, "xm yp+25 w200")
this.AddOutputButton("OB5", 0, "xm yp+25 w200")
this.AddOutputAxis("OutputAxis1", 0, "xm yp+25 w125")
this.AddOutputAxis("OutputAxis2", 0, "xm yp+25 w125")
}
; Called when the hotkey changes state (key is pressed or released)
MyHkChangedState(e){
if (e){ ; Only do this on press of the Input Button (e=1), do nothing on release (e=0)
static StickOps := UCR.Libraries.StickOps
; The input button was pressed, send the sequence of actions
Sleep 100
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 25
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 50
; Hold Button 5
this.OutputButtons.OB5.SetState(1)
Sleep 25
; Release Button 5
this.OutputButtons.OB5.SetState(0)
Sleep 100
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
; Release Button 2
this.OutputButtons.OB2.SetState(0)
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 800
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 150
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 382
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 25
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
; Release Button 2
this.OutputButtons.OB2.SetState(0)
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 75
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
} else {
; Input Button was released
; Release Button 2
this.OutputButtons.OB2.SetState(0)
}
}
}
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
Something like this (untested)
Code: Select all
class string4 extends _Plugin {
Type := "string4"
Description := "Your description here"
; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
Init(){
; Create the GUI
; Add a hotkey, and give it the name "MyHk1". All hotkey objects can be accessed via this.InputButtons[name]
; Have it call MyHkChangedState when it changes state.
this.AddInputButton("IB1", 0, this.MyHkChangedState.Bind(this), "xm ym w200")
; Add an Output, and give it the name "MyOp1". All output objects can be accessed via this.OutputButtons[name]
this.AddOutputButton("OB1", 0, "xm yp+25 w200")
this.AddOutputButton("OB2", 0, "xm yp+25 w200")
this.AddOutputButton("OB3", 0, "xm yp+25 w200")
this.AddOutputButton("OB4", 0, "xm yp+25 w200")
this.AddOutputButton("OB5", 0, "xm yp+25 w200")
this.AddOutputAxis("OutputAxis1", 0, "xm yp+25 w125")
this.AddOutputAxis("OutputAxis2", 0, "xm yp+25 w125")
this.AddInputButton("Stop", 0, this.StopPressed.Bind(this), "xm w200")
}
; Called when the hotkey changes state (key is pressed or released)
MyHkChangedState(e){
static StickOps := UCR.Libraries.StickOps
if (e){ ; Only do this on press of the Input Button (e=1), do nothing on release (e=0)
this.Stop := 0
; The input button was pressed, send the sequence of actions
Sleep 100
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
if (this.Stop)
return
Sleep 25
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
if (this.Stop)
return
Sleep 75
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
if (this.Stop)
return
Sleep 50
; Hold Button 5
this.OutputButtons.OB5.SetState(1)
if (this.Stop)
return
Sleep 25
; Release Button 5
this.OutputButtons.OB5.SetState(0)
if (this.Stop)
return
Sleep 100
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
if (this.Stop)
return
Sleep 25
; Release Button 2
this.OutputButtons.OB2.SetState(0)
if (this.Stop)
return
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
if (this.Stop)
return
Sleep 75
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
if (this.Stop)
return
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
if (this.Stop)
return
Sleep 800
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
if (this.Stop)
return
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
if (this.Stop)
return
Sleep 150
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
if (this.Stop)
return
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
if (this.Stop)
return
Sleep 382
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
if (this.Stop)
return
Sleep 25
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
if (this.Stop)
return
Sleep 25
; Release Button 2
this.OutputButtons.OB2.SetState(0)
if (this.Stop)
return
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
if (this.Stop)
return
Sleep 75
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
if (this.Stop)
return
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
if (this.Stop)
return
Sleep 75
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
if (this.Stop)
return
Sleep 25
} else {
; Input Button was released
; Release Button 2
this.OutputButtons.OB2.SetState(0)
}
}
StopPressed(e){
if (e){
this.Stop := 1
}
}
}
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
Of course, you could also have the sequence stop when you release the button:
[Edit] Hmm, this may not work. Not sure if another thread will launch on release. If not, try putting #MaxThreadsPerHotkey 2 at the start of the script.
If this is needed, let me know, and I will add it to the UCR source, because this setting can only be made once for all plugins, so it should default to something other than 1
Code: Select all
} else {
; Input Button was released
; Release Button 2
this.OutputButtons.OB2.SetState(0)
this.Stop := 1
}
If this is needed, let me know, and I will add it to the UCR source, because this setting can only be made once for all plugins, so it should default to something other than 1
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
i tried
with adding #MaxThreadsPerHotkey 2 at the start of the script and it does not work
Code: Select all
StopPressed(e){
if (e){
this.Stop := 1
}
}
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
You are right TheFatal, I was hoping that it could be done simpler, but it appears that it cannot.
The problem is that due to the way UCR works, one hotkey cannot interrupt another hottkey's processing - regardless of the state of SetBatchLines, #MaxThreadsPerHotkey etc.
However, there is a solution. What we need to do is to allow the hotkey function (in your case MyHkChangedState) to return, but still start sending the sequence of keys.
We do this with SetTimer. SetTimer allows you to call functions at a given point in time, and can be used to say "run this function when this function ends".
We also need to be careful - if the input button is set to a key, and "Suppress Repeats" is not on, then the Send Sequence will be triggered over and over. To prevent this, on the down event for the input button, i check if the sequence is already active, and if so just return.
The problem is that due to the way UCR works, one hotkey cannot interrupt another hottkey's processing - regardless of the state of SetBatchLines, #MaxThreadsPerHotkey etc.
However, there is a solution. What we need to do is to allow the hotkey function (in your case MyHkChangedState) to return, but still start sending the sequence of keys.
We do this with SetTimer. SetTimer allows you to call functions at a given point in time, and can be used to say "run this function when this function ends".
We also need to be careful - if the input button is set to a key, and "Suppress Repeats" is not on, then the Send Sequence will be triggered over and over. To prevent this, on the down event for the input button, i check if the sequence is already active, and if so just return.
Code: Select all
class string4 extends _Plugin {
Type := "string4"
Description := "Your description here"
; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
Init(){
; Create the GUI
; Add a hotkey, and give it the name "MyHk1". All hotkey objects can be accessed via this.InputButtons[name]
; Have it call MyHkChangedState when it changes state.
this.AddInputButton("IB1", 0, this.MyHkChangedState.Bind(this), "xm ym w200")
; Add an Output, and give it the name "MyOp1". All output objects can be accessed via this.OutputButtons[name]
this.AddOutputButton("OB1", 0, "xm yp+25 w200")
this.AddOutputButton("OB2", 0, "xm yp+25 w200")
this.AddOutputButton("OB3", 0, "xm yp+25 w200")
this.AddOutputButton("OB4", 0, "xm yp+25 w200")
this.AddOutputButton("OB5", 0, "xm yp+25 w200")
this.AddOutputAxis("OutputAxis1", 0, "xm yp+25 w125")
this.AddOutputAxis("OutputAxis2", 0, "xm yp+25 w125")
this.AddInputButton("Stop", 0, this.StopPressed.Bind(this), "xm w200")
this.SequenceOn := 0
this.SendSequenceFn := this.SendSequence.Bind(this)
}
; Called when the hotkey changes state (key is pressed or released)
MyHkChangedState(e){
static StickOps := UCR.Libraries.StickOps
if (e){ ; Only do this on press of the Input Button (e=1), do nothing on release (e=0)
; Manually enforce "No repeats" (keyboard keys may repeat "down" events)
if (this.SequenceOn)
return
; Get the BoundFunc object for the Send Seqence function
fn := this.SendSequenceFn
; Pass the boundfunc object to SetTimer and ask it to execute it once this function exits...
; ... so that other hotkey functions can be called while SendSequence runs
SetTimer, % fn, -0
} else {
; Input Button was released
; Release Button 2
this.OutputButtons.OB2.SetState(0)
this.SequenceOn := 0
}
}
SendSequence(){
static StickOps := UCR.Libraries.StickOps
this.SequenceOn := 1
; The input button was pressed, send the sequence of actions
Sleep 100
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 25
if (!this.SequenceOn)
return
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
if (!this.SequenceOn)
return
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 50
if (!this.SequenceOn)
return
; Hold Button 5
this.OutputButtons.OB5.SetState(1)
Sleep 25
if (!this.SequenceOn)
return
; Release Button 5
this.OutputButtons.OB5.SetState(0)
Sleep 100
if (!this.SequenceOn)
return
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
if (!this.SequenceOn)
return
; Release Button 2
this.OutputButtons.OB2.SetState(0)
if (!this.SequenceOn)
return
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
if (!this.SequenceOn)
return
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
if (!this.SequenceOn)
return
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 800
if (!this.SequenceOn)
return
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
if (!this.SequenceOn)
return
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 150
if (!this.SequenceOn)
return
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
if (!this.SequenceOn)
return
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 382
if (!this.SequenceOn)
return
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 25
if (!this.SequenceOn)
return
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
if (!this.SequenceOn)
return
; Release Button 2
this.OutputButtons.OB2.SetState(0)
if (!this.SequenceOn)
return
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
if (!this.SequenceOn)
return
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
if (!this.SequenceOn)
return
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 75
if (!this.SequenceOn)
return
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
this.SequenceOn := 0
}
StopPressed(e){
if (e){
this.SequenceOn := 0
}
}
}
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
changed pluggin but still no effect
Code: Select all
class string4 extends _Plugin {
Type := "string4"
Description := "Your description here"
; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
Init(){
; Create the GUI
; Add a hotkey, and give it the name "MyHk1". All hotkey objects can be accessed via this.InputButtons[name]
; Have it call MyHkChangedState when it changes state.
this.AddInputButton("IB1", 0, this.MyHkChangedState.Bind(this), "xm ym w200")
; Add an Output, and give it the name "MyOp1". All output objects can be accessed via this.OutputButtons[name]
this.AddOutputButton("OB1", 0, "xm yp+25 w200")
this.AddOutputButton("OB2", 0, "xm yp+25 w200")
this.AddOutputButton("OB3", 0, "xm yp+25 w200")
this.AddOutputButton("OB4", 0, "xm yp+25 w200")
this.AddOutputButton("OB5", 0, "xm yp+25 w200")
this.AddOutputAxis("OutputAxis1", 0, "xm yp+25 w125")
this.AddOutputAxis("OutputAxis2", 0, "xm yp+25 w125")
this.AddInputButton("Stop", 0, this.StopPressed.Bind(this), "xm w200")
this.SequenceOn := 0
this.SendSequenceFn := this.SendSequence.Bind(this)
}
; Called when the hotkey changes state (key is pressed or released)
MyHkChangedState(e){
static StickOps := UCR.Libraries.StickOps
if (e){ ; Only do this on press of the Input Button (e=1), do nothing on release (e=0)
if (this.SequenceOn)
return
; Get the BoundFunc object for the Send Seqence function
fn := this.SendSequenceFn
; Pass the boundfunc object to SetTimer and ask it to execute it once this function exits...
; ... so that other hotkey functions can be called while SendSequence runs
SetTimer, % fn, -0
} else {
; Input Button was released
; Release Button 2
this.OutputButtons.OB2.SetState(0)
this.SequenceOn := 0
}
}
SendSequence(){
static StickOps := UCR.Libraries.StickOps
this.SequenceOn := 1
; The input button was pressed, send the sequence of actions
Sleep 100
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 25
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 50
; Hold Button 5
this.OutputButtons.OB5.SetState(1)
Sleep 25
; Release Button 5
this.OutputButtons.OB5.SetState(0)
Sleep 100
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
; Release Button 2
this.OutputButtons.OB2.SetState(0)
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 800
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 150
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 382
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 25
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
; Release Button 2
this.OutputButtons.OB2.SetState(0)
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 75
; Hold Button 1
this.OutputButtons.OB1.SetState(1)
Sleep 25
; Release Button 1
this.OutputButtons.OB1.SetState(0)
Sleep 75
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
Sleep 25
this.SequenceOn := 0
}
StopPressed(e){
if (e){
this.SequenceOn := 0
}
}
}
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
Did you change my code at all? did my code work?
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
if i use your script i need to hold input button to sequence work, but i want to press 1 button to start sequence and 1 another button to cancel it, is it possible ?evilC wrote:Did you change my code at all? did my code work?
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
My script has both methods.
If you do not want it to stop on release of button,comment out the line this.SequenceOn := 0 from StopPressed()
replace
with
If you do not want it to stop on release of button,
replace
Code: Select all
this.OutputButtons.OB2.SetState(0)
this.SequenceOn := 0
Code: Select all
this.OutputButtons.OB2.SetState(0)
;this.SequenceOn := 0
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
works now, tnx a lot
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
i have one more question: can i use 1 button (space for example) to cancel sequences from 4 plugins ?
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
I had intended on supporting inter-plugin communication, which would allow that, but for the moment, as far as I am aware there is nothing stopping you from binding the same key as an input for multiple plugins.
So simply bind Space to the stop button for all the plugins.
I had originally intended to not allow you to bind the same key in multiple places, but I am now coming to the conclusion that would be a bad idea. Maybe warn the user, but it should be allowed as it clearly has it's uses.
So simply bind Space to the stop button for all the plugins.
I had originally intended to not allow you to bind the same key in multiple places, but I am now coming to the conclusion that would be a bad idea. Maybe warn the user, but it should be allowed as it clearly has it's uses.
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
well i bind space in 2 plugins, in 1 it works correctly, in 2 it does not workevilC wrote:I had intended on supporting inter-plugin communication, which would allow that, but for the moment, as far as I am aware there is nothing stopping you from binding the same key as an input for multiple plugins.
So simply bind Space to the stop button for all the plugins.
I had originally intended to not allow you to bind the same key in multiple places, but I am now coming to the conclusion that would be a bad idea. Maybe warn the user, but it should be allowed as it clearly has it's uses.
https://i.gyazo.com/215ba38e4ef82b90bd4 ... 07dc6e.png
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
I have been toying around with ideas for incorporating the Profile Toolbox into the main UI.
I have come up with this (AHK_H required)
Note that the Toolbox (Red) pane can be resized using it's left edge.
This version uses the actual border of the toolbox window to do the resize, but I may end up doing my own version as it is not easy to see the border.
This technique also requires specific layering and sizing to that only the left border of the toolbox window is visible.
I have come up with this (AHK_H required)
Note that the Toolbox (Red) pane can be resized using it's left edge.
This version uses the actual border of the toolbox window to do the resize, but I may end up doing my own version as it is not easy to see the border.
This technique also requires specific layering and sizing to that only the left border of the toolbox window is visible.
Code: Select all
#SingleInstance force
OutputDebug DBGVIEWCLEAR
MAIN_WIDTH := 100
Gui +HwndhMainGui
Gui, % hMainGui ":Margin", 0, 0
Gui, % hMainGui ":+Resize"
Gui, New, HwndhSidePanel
Gui, % hSidePanel ":+Resize"
Gui, % hSidePanel ":-Caption"
Gui, % hSidePanel ":Add", Edit, w100 aw ah , Profile Toolbox
Gui, % hSidePanel ":Show", Hide
Gui, % hSidePanel ":Color", Red
Gui, % hMainGui ":Add", Gui, % "x" MAIN_WIDTH " ", % hSidePanel
Gui, New, HwndhTopPanel
Gui, % hTopPanel ":Add", Edit, aw ah, Top Panel
Gui, % hTopPanel ":-Caption"
Gui, % hTopPanel ":Show", Hide
Gui, % hTopPanel ":Color", Blue
Gui, % hMainGui ":Add", Gui, % "x0 w" MAIN_WIDTH " h50", % hTopPanel
Gui, New, HwndhPluginArea
Gui, % hPluginArea ":-Caption"
Gui, % hPluginArea ":+Scroll"
;Gui, % hPluginArea ":+MaxSize500" ; Doesn't work :(
Gui, % hPluginArea ":Show", Hide
Gui, % hPluginArea ":Color", Green
Gui, % hMainGui ":Add", Gui, % "w" MAIN_WIDTH " h50 x0", % hPluginArea
Gui, % hMainGui ":Show", x0 y0 Hide, UCR Layout POC
Gui, % hMainGui ":Show", x0 y0 w400 h300
Loop 10 {
Gui, % hPluginArea ":Add", Edit, w400 h50, % "Plugin " A_Index
}
return
GuiSize(hwnd, EventInfo, Width, Height){
static tw := 100
global hMainGui, hSidePanel, hTopPanel, hPluginArea
if (hwnd == hSidePanel && tw != rect.Width){
; Side panel dragged
rect := WindowGetRect(hwnd)
OutputDebug % "UCR| Toolbar - Width: " rect.Width " tw: " tw
tw := rect.Width
; Set variables for MainGui, allow to drop through and re-draw main window
hwnd := hMainGui
rect := WindowGetRect(hwnd)
Width := rect.Width, Height := rect.Height
}
if (hwnd == hMainGui){
OutputDebug % "UCR| Main Width: " Width
Gui % hTopPanel ":Show", % "x0 y0 w" Width " h40"
;Gui % hPluginArea ":Show", % "x0 y40 w" Width - tw - 20 " h" Height - 40
GuiControl, % hMainGui ":Move", % hPluginArea, % "x0 y40 w" Width - tw " y40 h" Height - 40
Gui % hSidePanel ":Show", % "x" Width - tw " y30 w" tw " h" Height - 35
;GuiControl, % hMainGui ":Move", % hSidePanel, % "x" Width - tw " y40 w" tw " h" Height - 40
}
}
WindowGetRect(hwnd) {
VarSetCapacity(rect, 16, 0)
DllCall("GetClientRect", "Ptr", hwnd, "Ptr", &rect)
return {width: NumGet(rect, 8, "Int"), height: NumGet(rect, 12, "Int")}
}
GuiClose:
ExitApp
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
Yeah, of course, thinking about it, I was thinking per profile, not per plugin.
Being able to talk to other plugins will not happen until I give each plugin a unique ID.
When I do that, then I could make a plugin selector like the profile selector, and you could configure one plugin to be able to point to another.
So usage would be something like:
PluginSelects.MyPluginSelect.PleaseStop() to call the "PleaseStop()" function in the plugin that the user selected.
Being able to talk to other plugins will not happen until I give each plugin a unique ID.
When I do that, then I could make a plugin selector like the profile selector, and you could configure one plugin to be able to point to another.
So usage would be something like:
PluginSelects.MyPluginSelect.PleaseStop() to call the "PleaseStop()" function in the plugin that the user selected.
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
so is there any way to bind global stop button for all plugins in profile ?
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
I have not provided a mechanism to do it, but it could be done.
For example, if in the Init() function of plugin A, you put:
UCR.PluginA:= this
Then you could call the "StopSequence()" function of PluginA from PluginB by using this code in PluginB:
UCR.PluginA.StopSequence()
Or you could store the variable on the parent profile:
Put in PluginA's Init():
this.ParentProfile.PluginA:= this
In Plugin B:
this.ParentProfile.PluginA.StopSequence()
For example, if in the Init() function of plugin A, you put:
UCR.PluginA:= this
Then you could call the "StopSequence()" function of PluginA from PluginB by using this code in PluginB:
UCR.PluginA.StopSequence()
Or you could store the variable on the parent profile:
Put in PluginA's Init():
this.ParentProfile.PluginA:= this
In Plugin B:
this.ParentProfile.PluginA.StopSequence()
Re: Universal Control Remapper (UCR) - v0.0.7 13th Mar 2016
New version released
Code: Select all
0.0.12 - 17th May 2016
+ The Profile Toolbox is now integrated into the rest of the UI
The UI is now resizable horizontally, so you can resize the profile toolbox.
Re: Universal Control Remapper (UCR) - v0.0.12 17th May 2016
New release - quite a lot in here.
PLEASE READ THE RELEASE NOTES AT THE BOTTOM OF THE POST. TLDR: BACK UP YOUR INI FILE BEFORE RUNNING
First up, plugins now all have a unique ID, in fact profiles also moved to a new "GUID" system.
This does not really change anything now, but it opens the door to many possibilities in the future.
Secondly, and more noticeably, the state of the hotkeys for each profile is shown in the profile toolbox.
Blue = Current profile, so is obviously active/
Green = profile running, hotkeys active (will just be global profile for now, but could optionally be parent profile too soon)
Amber = hotkey thread loaded but inactive, profile inactive. (ie ready to be turned on very quickly).
If you point a profile switcher plugin to another profile, that profile will turn amber to tell you that it is "linked" and ready to rock at a moment's notice.
The plan is to allow you to set a profile to inherit the hotkeys of it's parent (ie when that profile is active, also keep the parent active).
In this way, you can do "shift states" without having to reproduce all the controls on each shifted profile, and all the needed profiles stay running and ready to shift to, but all your other profiles stay out of memory.
PLEASE READ THE RELEASE NOTES AT THE BOTTOM OF THE POST. TLDR: BACK UP YOUR INI FILE BEFORE RUNNING
First up, plugins now all have a unique ID, in fact profiles also moved to a new "GUID" system.
This does not really change anything now, but it opens the door to many possibilities in the future.
Secondly, and more noticeably, the state of the hotkeys for each profile is shown in the profile toolbox.
Blue = Current profile, so is obviously active/
Green = profile running, hotkeys active (will just be global profile for now, but could optionally be parent profile too soon)
Amber = hotkey thread loaded but inactive, profile inactive. (ie ready to be turned on very quickly).
If you point a profile switcher plugin to another profile, that profile will turn amber to tell you that it is "linked" and ready to rock at a moment's notice.
The plan is to allow you to set a profile to inherit the hotkeys of it's parent (ie when that profile is active, also keep the parent active).
In this way, you can do "shift states" without having to reproduce all the controls on each shifted profile, and all the needed profiles stay running and ready to shift to, but all your other profiles stay out of memory.
Code: Select all
Key:
! : Warning
* : Comment
= : Change / Fix
+ : Added feature
0.0.13 - 21st May 2016
! INI (Settings) file format changed. UCR will attempt to upgrade for you.
YOU ARE ADVISED TO BACK UP YOUR UCR.INI BEFORE RUNNING THIS VERSION.
If you have problems, please post on the forums.
= Plugins are now uniquely identified by IDs.
This does not affect anything now, but it is an enabler for future features.
eg: Renaming of plugins, moving plugins between profiles, inter-plugin communication.
= All IDs (Profile and Plugin) are now GUIDs generated via windows APIs
+ Status of Input Threads is now show in the Profile Toolbox.
Blue = current profile, Green = active (eg global), Amber = Loaded but paused
= Fixes to logic for loading / unloading of Input Threads
= Up event for joystick buttons should now properly trigger...
... when entering a profile with the button already held.
+ UCR should now wait until done saving if you close the GUI mid-save.
+ Profile Toolbox now has a title in the GUI
Return to “Gaming Scripts (v1)”
Who is online
Users browsing this forum: No registered users and 22 guests