Skip to content

Commit dce6150

Browse files
committed
Adds toggle mode to ButtonToButton
1 parent bb09ea6 commit dce6150

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

Changelog.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,24 @@ Key:
55
+ : Added feature
66

77
0.0.16 - ??
8+
+ The ButtonToButton plugin now has a Toggle mode
9+
+ MouseToJoy plugin enhancements:
10+
Renamed Threshold in Absolute mode to Scale Factor.
11+
You may lose your setting for this GuiControl as it was renamed.
12+
Plugin can now be configured to only take input from a specific mouse.
13+
You can now use multiple MouseToJoy plugins if you have more than one pointing device.
14+
+ Added "HoldButton" functionality to OneSwitch Pulse plugin.
15+
= InputActivity subscriptions no longer fire if the plugin is not active.
16+
This only really affects OneSwitch Pulse or any custom plugins using InputActivity.
817
= Fixed bug that occurred when changing an InputButton plugin from button to hat:
918
The old binding was remaining active, this is now fixed.
1019
= Fixed bug that occurred when changing an InputButton from keyboard to vJoy:
1120
The vJoy selection UI would change selection of various elements in odd ways.
1221
= A bunch of behind-the-scenes changes and fixes.
1322
Please let me know if stuff that used to work now doesn't.
14-
+ Numerous fixes and tweaks to the The MouseToJoy plugin:
15-
Renamed Threshold in Absolute mode to Scale Factor.
16-
You may lose your setting for this GuiControl as it was renamed.
23+
= MouseToJoy plugin fixes:
1724
Fixed numerous bugs which made Absolute mode center the stick way too much.
18-
It can now be configured to only take input from a specific mouse.
19-
You can now use multiple MouseToJoy plugins if you have more than one pointing device.
20-
= The Timeout value for Absolute mode in the Mouse to Joystick plugin now works.
21-
+ OneSwitch Pulse now properly holds the HoldButton when pulse is on.
22-
+ Added "HoldButton" functionality to OneSwitch Pulse plugin.
23-
+ InputActivity subscriptions no longer fire if the plugin is not active.
24-
This only really affects OneSwitch Pulse or any custom plugins using InputActivity.
25+
The Timeout value for Absolute mode now works.
2526

2627
0.0.15 - 24th July 2016
2728
! All ProfileSwitcher plugins will no longer be bound to a profile.

Classes/GuiControls/OutputButton.ahk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
; ======================================================================== OUTPUT BUTTON ===============================================================
22
; An Output allows the end user to specify which buttons to press as part of a plugin's functionality
33
Class _OutputButton extends _InputButton {
4+
State := 0
45
_DefaultBanner := "Drop down the list to select an Output"
56
_IsOutput := 1
67
_OptionMap := {Select: 1, vJoyButton: 2, Clear: 3}

Plugins/Core/ButtonToButton.ahk

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,21 @@ class ButtonToButton extends _Plugin {
2222
Gui, Add, Text, x+5 yp+2 , % " to "
2323
; Add an Output, and give it the name "MyOp1". All output objects can be accessed via this.OutputButtons[name]
2424
this.AddOutputButton("OB1", 0, "x+5 yp-2 w200")
25+
this.AddControl("Toggle", 0, "Checkbox", "x+20 yp+3", "Toggle mode")
2526
}
2627

2728
; Called when the hotkey changes state (key is pressed or released)
2829
MyHkChangedState(Name, e){
29-
OutputDebug, % Name " changed state to: " (e ? "Down" : "Up")
30-
;Tooltip % this.OutputButtons[name].value
31-
; Set the state of the output to match the state of the input
32-
this.OutputButtons.OB1.SetState(e)
30+
;OutputDebug, % "UCR| " Name " changed state to: " (e ? "Down" : "Up")
31+
if (this.GuiControls.Toggle.value){
32+
; Toggle mode - Toggle the state of the output when the input goes down
33+
if (e){
34+
this.OutputButtons.OB1.SetState(!this.OutputButtons.OB1.State)
35+
}
36+
} else {
37+
; Normal mode - Set the state of the output to match the state of the input
38+
this.OutputButtons.OB1.SetState(e)
39+
}
40+
3341
}
3442
}

0 commit comments

Comments
 (0)