You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ctrlTxt=UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow
195
138
{
196
-
If (A_Cursor!="IBeam")
139
+
MouseGetPos, MouseX, MouseY
140
+
PixelGetColor, color, %MouseX%, %MouseY%
141
+
142
+
If (A_Cursor="IBeam"|| (color!="0x202020"&&color!="0x1F1F1F"&&color!="0x393939"&&color!="0xAEAEAE"&&color!="0x4B92F3"&&color!="0xCB3022"&&color!="0xF6FF9A"))
197
143
{
198
-
Return
144
+
whileGetKeyState(key, "P")
145
+
{
146
+
Send, {%key%}
147
+
sleep, Max(400-A_Index*100, 50)
148
+
}
199
149
}
200
150
else
201
151
{
202
-
SendInput, %key%
152
+
global blockedKeyInput:=key
153
+
KeyWait, %key%
154
+
global blockedKeyInput:=""
155
+
Return
203
156
}
204
157
}
205
158
else
206
159
{
207
-
Send, {%key% Down}
208
-
KeyWait, %key%
209
-
Send, {%key% Up}
160
+
whileGetKeyState(key, "P")
161
+
{
162
+
Send, {%key%}
163
+
sleep, Max(400-A_Index*100, 50)
164
+
}
210
165
}
211
166
}
212
167
213
-
ExitScrit:
214
-
ExitApp
215
-
Return
216
-
217
-
CreateNode(nodeName)
168
+
TryGetAnyKey()
218
169
{
219
170
ifWinExist("A")
220
171
ControlGetFocus, curCtrl
221
172
ControlGetText, ctrlTxt, %curCtrl%
222
173
if ctrlTxt=UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow
223
174
{
224
-
global nodesPath
225
-
clipSaved:=ClipBoardAll
226
-
FileRead, nodeclip, %nodesPath%\%nodeName%.txt
227
-
Clipboard:=nodeclip
228
-
ClipWait0.2, 1
229
-
; WinMenuSelectItem is lag, don't use it
230
-
;;;;; WinMenuSelectItem, A,, Edit, Paste
231
-
Send, {CtrlDown}v
232
-
Sleep, 10
233
-
Send, {CtrlUp}
234
-
Sleep, 10
235
-
Clipboard:=clipSaved
236
-
ClipWait0.1, 1
237
-
; MsgBox, %nodesPath% | %fileName% | %nodeclip%
175
+
global blockedKeyInput
176
+
177
+
InputHook :=A_PriorKey
178
+
; InputHook := Format(Upper , %InputHook)
179
+
StringUpper, InputHook, InputHook
180
+
; ToolTip, %InputHook%
181
+
IfGetKeyState(A_PriorKey) || blockedKeyInput!=""
182
+
{
183
+
Switch blockedKeyInput
184
+
{
185
+
Case "a": InputHook:="A"
186
+
Case "o": InputHook:="O"
187
+
Case "f": InputHook:="F"
188
+
}
189
+
190
+
Switch InputHook
191
+
{
192
+
Case "0": CreateNode("Integer")
193
+
Case "1": CreateNode("Float")
194
+
Case "2": CreateNode("Vector2")
195
+
Case "3": CreateNode("Vector3")
196
+
Case "4": CreateNode("Vector4")
197
+
Case "5": CreateNode("Color")
198
+
Case "B": CreateNode("Split")
199
+
Case "V": CreateNode("Combine")
200
+
Case "G": CreateNode("GetVariable") ; https://github.com/Cyanilux/ShaderGraphVariables
201
+
Case "R": CreateNode("RegisterVariable") ; https://github.com/Cyanilux/ShaderGraphVariables
0 commit comments