-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSwitchWedge022724.ahk
1748 lines (1582 loc) · 43.3 KB
/
SwitchWedge022724.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
iniF := "sw.ini" ; initializes startup state-mostly for scan mouse
iniH := "swsettings" ; There is only one section in the ini file
bar_char := "|"
reloading = 0
reLoad:
OpMode = Single Switch
Scanner = 1
ScanRate = 4
dragging = 0
slowSend = 1
moving = 0
SetupName = %iniH%
SetupList:= ""
keyIn1 = +Tab ; default key trigger
keyIn2 = Backspace
keyIn3 = Tab ; default key trigger
keyIn4 = Space
keyIn5 = Right
xpos = 0 ; target coodinates
ypos = 0
x2pos = 0
y2pos = 0
xpos1 = 100
ypos1 = 0
xpos2 = 200
ypos2 = 0
xpos3 = 300
ypos3 = 0
xpos4 = 400
ypos4 = 0
xpos5 = 500
ypos5 = 0
xpos6 = 600
ypos6 = 0
xpos7 = 700
ypos7 = 0
xpos8 = 800
ypos8 = 0
xpos9 = 900
ypos9 = 0
xpos10 = 1000
ypos10 = 0
spotIx = 0
spotMsg = "text"
spotTalk = 0
spotScanIx = 0
clickIx = 1
maskTimer = 0
notMasking = 1
scanning = 0
mouseSpeed = 125 ; sets mouse speed where smaller is faster
mouseState = 4
mouseOffset = 10 ; sets the smallest distance in pixels the mouse can move
mouseClickState = 0
scanMouseMode = 1
shrunk = 0
ttVisible = 0
ttText = This is it!
winWid = w650
winWidMin = w650
winHgtMax = h200
winHgtMin = h25
lastHgt = w650
lastWid = h200
Msg1 = {Tab}
Msg2 = {Enter}
Msg3 = +{Tab}
Msg4 = {Space}
Msg5 = {right}
customMsg1 = ? ; add a string to send for first message (hilite)
customMsg2 = ? ; add a string to send for second msg (select)
customMsg3 = ? ; add a string to send for third message (remap only)
customMsg4 = ? ; add a string to send for fourth msg (remap only)
customMsg5 = hey ; add a string to send for fifth msg (remap only)
StartOff = 1
noHelp = 1
viewInfo = 0
suspended = 1
cbTTS = 0
HelpText = Context help
infoText = SwitchWedge can enhance accessibility to many programs and websites, and it can greatly increase the utility of common switch interfaces such as keyboard emulators like the DJ Switch Interface Pro, adapted mice, or adapted joysticks/gamepads. SwitchWedge supports up to 5 switches, and offers a number of operating modes to trigger various helpful actions. The two leftmost inputs (triggers) are associated with these operating modes allowing them to support:`n`n 1. - Single Switch scanning - the first switch activation repeatedly sends a user defined keystroke to an application at the scan rate to highlight items. A second activation of the same switch sends the second user defined keystroke to select an item.`n 2. - Two Switch scanning- The user uses separate switches, one to send keystrokes for moving the scan highlight and one to select an item.`n 3. - One Click - the switch activation sends a click to a user defined target. Subsequent switch hits are ignored during the Mask Time interval that follows the initial trigger.`n 4. - Two Click - The trigger sends a click at a first target and then after the Scan Rate interval, a second click to a second target. Subsequent triggers are ignored during the Mask Time interval that follows the initial trigger.`n 5. - Scan Mouse 1 - The trigger initiates a sequence of tool tips that appear near the mouse cursor at the Scan Rate which describe mouse actions: either mouse moves or mouse clicks. The user can move the mouse cursor as defined by the Mouse Speed where smaller numbers yield a faster movement.`n 6. - Scan Mouse 2 - Same as Scan Mouse 1 but adds the possibility of auditory support for scanning by copying the tool tip text to the clipboard where a helper program like TTSReader, Orato, ClipSpeak, or Deskbot can read it outloud.`n 7. - Scan Spot 1 and 2 -You can define up to 10 spots on the screen that get 'scanned'. Either keyboard trigger starts the scan which sequentially positions the mouse cursor over each spot at the scan rate. A second trigger stops the scan and sends a mouse click to the last mouse position. Scan Spot 2 allows you to enter auditory cue text for each spot. The cues are spoken by a helper clipboard text-to-speech application like Orato or Deskbot. `n 8. - Remap Mode - sends whatever message is associated with each of the triggers to the active application. You can set a Mask interval as well. `n`n The other 3 inputs operate as simple key/click sequence remappers. By setting a custom key sequence for any input, a user can issue a long sequence of keys and clicks with a single switch activation. `n Note that the leftmost 2 triggers take presidence of the other 3. In any case, avoid using the same definitions for more than 1 trigger, except for 'none'- the no trigger setting. Finally, you can save named setups to make reconfiguring SwitchWedge for favorite applications easy and quick.`n`n Other keyboard shortcuts:`n Press ~ to Suspend or Resume SwitchWedge. SwitchWedge must be resumed to record hotspots.`n Press Alt-s key combo to Shrink or Expand the SwitchWedge window. `n Press the Alt-t key combo to capture the name of the active window and to optionally save a setup with this name.`n`n Press the "Help" button in SwitchWedge to close this window.
HelpTitle = Some Mode
infoTitle = General Info About SwitchWedge
goSub, iniSetup
Gui,font,s10,Bold
Gui, Add, GroupBox, x108 y0 w134 h86
Gui, Add, GroupBox, x248 y0 w204 h86
Gui, Add, GroupBox, x108 y92 w345 h74
Gui, Add, Text, x2 y2 w100 h20, Operating As:
Gui, Add, Text, x305 y2 w96 h20, Other Remaps-
Gui, Add, Text, x2 y32 w100 h20 , Switch Triggers:
Gui, Add, Text, x184 y92 w200 h20 , Define Custom Key Sequences-
Gui, Add, Text, x2 y62 w100 h20 , Key Seq. Sent:
Gui, Add, Checkbox, x2 y92 gSetVars vStartOff Checked%StartOff%, Start SW Off?
Gui, Add, Text, x475 y32 w100 h20, Scan Rate:
Gui, Add, Text, x475 y62 w100 h20, Mask Time:
Gui, Add, Text, x475 y92 w120 h20, Mouse Speed:
Gui, Add, Checkbox, x475 y118 w120 Checked%slowSend% vslowSend gSetVars, Slow Send
Gui, Add, Text, x2 y174 w90, Get Setup:
Gui,font,,
Gui, Add, Text, x475 y142 w170 h80, Add new features to your DJ or Quizworks Switch Interface.`n`n--->Press ~ to Suspend/Resume
Gui, Add, DropDownList, x110 y2 w130 gSetMode vOpMode, %OpMode%||Single Switch|Two Switch|One Click|Two Click|Scan Mouse 1|Scan Mouse 2|Spot Scan 1|Spot Scan 2|2 Switch Spot Scan 1|2 Switch Spot Scan 2|Remap|Click List
Gui,Add, Button, x588 y2 w60 h20 gGetHelp, Help
Gui, Add, Button, x475 y2 w110 h20 gShrinkShow, Show/Hide Cntrls
Gui, Add, DropDownlist, x582 y92 w60 gsetVars vmouseSpeed, %mouseSpeed%||25|50|75|100|125|150|175|200|225
Gui, Add, DropDownList, x110 y32 w60 gSetVars vkeyIn1, %keyIn1%||0|1|2|3|Space|Enter|Tab|+Tab|BackSpace|Right|Left|Up|Down|LButton|RButton|MButton|Joy1|Joy2|Joy3|Joy4|Joy5|Joy6|Joy7|Joy8|none
Gui, Add, DropDownList, x180 y32 w60 gSetVars vkeyIn2, %keyIn2%||0|1|2|3|Space|Enter|Tab|+Tab|BackSpace|Right|Left|Up|Down|LButton|RButton|MButton|Joy1|Joy2|Joy3|Joy4|Joy5|Joy6|Joy7|Joy8|none
Gui, Add, DropDownList, x250 y32 w60 gSetVars vkeyIn3, %keyIn3%||0|1|2|3|Space|Enter|Tab|+Tab|BackSpace|Right|Left|Up|Down|LButton|RButton|MButton|Joy1|Joy2|Joy3|Joy4|Joy5|Joy6|Joy7|Joy8|none
Gui, Add, DropDownList, x320 y32 w60 gSetVars vkeyIn4, %keyIn4%||0|1|2|3|Space|Enter|Tab|+Tab|BackSpace|Right|Left|Up|Down|LButton|RButton|MButton|Joy1|Joy2|Joy3|Joy4|Joy5|Joy6|Joy7|Joy8|none
Gui, Add, DropDownList, x390 y32 w60 gSetVars vkeyIn5, %keyIn5%||0|1|2|3|Space|Enter|Tab|+Tab|BackSpace|Right|Left|Up|Down|LButton|RButton|MButton|Joy1|Joy2|Joy3|Joy4|Joy5|Joy6|Joy7|Joy8|none
Gui, Add, DropDownList, x110 y62 w60 gSetVars vMsg1, %Msg1%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|%customMsg1%
Gui, Add, DropDownList, x180 y62 w60 gSetVars vMsg2, %Msg2%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|%customMsg2%
Gui, Add, DropDownList, x250 y62 w60 gSetVars vMsg3, %Msg3%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|%customMsg3%
Gui, Add, DropDownList, x320 y62 w60 gSetVars vMsg4, %Msg4%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|%customMsg4%
Gui, Add, DropDownList, x390 y62 w60 gSetVars vMsg5, %Msg5%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|%customMsg5%
Gui, Add, DropDownList, x582 y32 w60 gSetVars vScanRate, %scanRate%||1|2|3|4|5|6|7|10|15|20|30|45|60|90|120
Gui, Add, DropDownList, x582 y62 w60 gSetVars vMaskTimer, %maskTimer%||0|1|2|3|4|5|6|7|8
Gui, Add, Button, x110 y112 w60 h20 gsetCustom1, Set Seq. 1
Gui, Add, Button, x180 y112 w60 h20 gsetCustom2, Set Seq. 2
Gui, Add, Button, x250 y112 w60 h20 gsetCustom3, Set Seq. 3
Gui, Add, Button, x320 y112 w60 h20 gsetCustom4, Set Seq. 4
Gui, Add, Button, x390 y112 w60 h20 gsetCustom5, Set Seq. 5
Gui, Add, Button, x427 y142 w20 h20 gcustomHelp,?
Gui, Add, Edit, x112 y142 w310 h20 vCustom, Enter Your Custom Sequence Here
Gui, Add, DropDownList, x112 y174 w260 gpickSetup viniH, %iniH%||%SetupList%
Gui, Add, Button, x380 y174 w70 gsaveThisSetup, Save setup
Gui, Color, 37DFDF
CoordMode, Mouse, Screen
CoordMode, toolTip, Screen
GoSub, setVars
GoSub, loadSetupList
if (StartOff)
{
suspended = 1
Suspend On
Gui, Show, x10 y10 %lastHgt% %lastWid%, SwitchWedge2 DW Edition OFF -->Setup for: %iniH%
} Else
{
suspended = 0
Suspend Off
Gui, Show, x10 y10 %lastHgt% %lastWid%, SwitchWedge022724 ON -->Setup for: %iniH%
}
setTitleMatchMode 2
goSub, setMode
IfwinExist, SwitchWedge
{
WinSet, AlwaysOnTop, On, SwitchWedge
}
return
m_x = 0
m_y = 0
tipText = ""
!m::
MouseGetPos, m_x, m_y,,
tipText := "mouse position is " . m_x . " , " . m_y
toolTip %tipText%
return
; dismiss tootip --> Ctl+Alt+m
^!m::
toolTip
return
`::
+`::
Suspend
gosub, SuspendToggle
return
SuspendToggle:
if !(suspended)
{
suspended = 1
Suspend On
goSub, KillScan
msgBox, SwitchWedge Action is OFF - Press ~ to re-activate. Press Enter to close this box.
Gui, Show, x10 y10 %lastHgt% %lastWid%, SwitchWedge Off -->Setup for: %iniH%
WinRestore, SwitchWedge
}
else
{
suspended = 0
suspend Off
msgBox, SwitchWedge Action is ON - Press Enter to close this box.
Gui, Show, x10 y10 %lastHgt% %lastWid%, SwitchWedge On -->Setup for: %iniH%
WinMinimize, SwitchWedge
}
return
!s::
gosub, shrinkShow
return
!t::
suspend, permit
WinGetActiveTitle, SaveSetup
gosub, setupSaver
return
setupSaver:
MsgBox,35, Change the name to save as a new setup, Yes = save, or rename this setup. No = Skip saving
ifMsgBox Yes
{
inputBox, SaveSetup, You Can Save This Setup or Create a New One, For a new setup edit this setup name- current setup is:,,,,,,,,%SaveSetup%
StringReplace, SaveSetup, SaveSetup, %bar_char%,, All
msgBox,1,Is the %SaveSetup% Setup OK to Save?, Setup to be saved is called: %SaveSetup%
ifMsgBox OK
{
iniH = %SaveSetup%
guiControl,,iniH,|%iniH%||%SetupList%
gosub, saveIniSetup
if (suspended)
{
Gui, Show,, SwitchWedge Off -->Setup for: %iniH%
}
else
{
Gui, Show,, SwitchWedge On -->Setup for: %iniH%
}
}
}
return
saveThisSetup:
Gui,Submit,NoHide
SaveSetup = %iniH%
gosub, setupSaver
return
GetHelp:
!F1::
suspend, permit
run, SwitchWedgeHelp022724.html
return
; Record mouse positions over targets
!1::
suspend, permit
posIx := 1
if (posIx > spotIx) {
spotIx := posIx
scanSpotIx := 0
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!2::
suspend, permit
posIx := 2
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!3::
suspend, permit
posIx := 3
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!4::
suspend, permit
posIx := 4
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!5::
suspend, permit
posIx := 5
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!6::
suspend, permit
posIx := 6
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!7::
suspend, permit
posIx := 7
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!8::
suspend, permit
posIx := 8
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!9::
suspend, permit
posIx := 9
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!0::
suspend, permit
posIx := 10
scanSpotIx := 0
if (posIx > spotIx) {
spotIx := posIx
}
MouseGetPos, xpos%posIx%, ypos%posIx%
if (spotTalk)
{
InputBox, spotMsg%posIx%, Enter a verbal cue,,,,150,,,,,Nothing
}
Gosub, saveIniSetup
return
!z::
suspend, permit
spotIx := 0
If (OpMode == "Spot Scan 1") OR (OpMode == "Spot Scan 2")
{
msgBox, Spot scan is reset.
}
If (OpMode == "Click List")
{
msgBox, Click List is reset.
}
return
; Hotkeys for DJ switch interface, adapted mouse, and joystick buttons 1 to 8. If trigger (keyIn2)or(keyIn1) == hotkey
; then act according to OpMode, or else just pass key along. if keyIn3,4,5 == hotkey then send remapping.
$0::
whatBtn := 0
if (keyIn3 == 0)
whatBtn := 3
if (keyIn4 == 0)
whatBtn := 4
if (keyIn5 == 0)
whatBtn := 5
if (keyIn1 == 0)
whatBtn := 1
if (keyIn2 == 0)
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send 0
}
return
$1::
whatBtn := 0
if (keyIn3 == 1)
whatBtn := 3
if (keyIn4 == 1)
whatBtn := 4
if (keyIn5 == 1)
whatBtn := 5
if (keyIn1 == 1)
whatBtn := 1
if (keyIn2 == 1)
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send 1
}
return
$2::
whatBtn := 0
if (keyIn3 == 2)
whatBtn := 3
if (keyIn4 == 2)
whatBtn := 4
if (keyIn5 == 2)
whatBtn := 5
if (keyIn1 == 2)
whatBtn := 1
if (keyIn2 == 2)
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send 2
}
return
$3::
whatBtn := 0
if (keyIn3 == 3)
whatBtn := 3
if (keyIn4 == 3)
whatBtn := 4
if (keyIn5 == 3)
whatBtn := 5
if (keyIn1 == 3)
whatBtn := 1
if (keyIn2 == 3)
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send 3
}
return
$Tab::
whatBtn := 0
if (keyIn1 == "Tab")
whatBtn := 1
if (keyIn2 == "Tab")
whatBtn := 2
if (keyIn3 == "Tab")
whatBtn := 3
if (keyIn4 == "Tab")
whatBtn := 4
if (keyIn5 == "Tab")
whatBtn := 5
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Tab}
}
return
$+Tab::
whatBtn := 0
if (keyIn1 == "+Tab")
whatBtn := 1
if (keyIn2 == "+Tab")
whatBtn := 2
if (keyIn3 == "+Tab")
whatBtn := 3
if (keyIn4 == "+Tab")
whatBtn := 4
if (keyIn5 == "+Tab")
whatBtn := 5
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Shift}+{Tab}
}
return
$Space::
whatBtn := 0
if (keyIn3 == "Space")
whatBtn := 3
if (keyIn4 == "Space")
whatBtn := 4
if (keyIn5 == "Space")
whatBtn := 5
if (keyIn1 == "Space")
whatBtn := 1
if (keyIn2 == "Space")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Space}
}
return
$Enter::
whatBtn := 0
if (keyIn3 == "Enter")
whatBtn := 3
if (keyIn4 == "Enter")
whatBtn := 4
if (keyIn5 == "Enter")
whatBtn := 5
if (keyIn1 == "Enter")
whatBtn := 1
if (keyIn2 == "Enter")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Enter}
}
return
$Backspace::
whatBtn := 0
if (keyIn3 == "Backspace")
whatBtn := 3
if (keyIn4 == "Backspace")
whatBtn := 4
if (keyIn5 == "Backspace")
whatBtn := 5
if (keyIn1 == "Backspace")
whatBtn := 1
if (keyIn2 == "Backspace")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Backspace}
}
return
$Up::
whatBtn := 0
if (keyIn3 == "Up")
whatBtn := 3
if (keyIn4 == "Up")
whatBtn := 4
if (keyIn5 == "Up")
whatBtn := 5
if (keyIn1 == "Up")
whatBtn := 1
if (keyIn2 == "Up")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Up}
}
return
$Down::
whatBtn := 0
if (keyIn3 == "Down")
whatBtn := 3
if (keyIn4 == "Down")
whatBtn := 4
if (keyIn5 == "Down")
whatBtn := 5
if (keyIn1 == "Down")
whatBtn := 1
if (keyIn2 == "Down")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Down}
}
return
$Left::
whatBtn := 0
if (keyIn3 == "Left")
whatBtn := 3
if (keyIn4 == "Left")
whatBtn := 4
if (keyIn5 == "Left")
whatBtn := 5
if (keyIn1 == "Left")
whatBtn := 1
if (keyIn2 == "Left")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Left}
}
return
$Right::
whatBtn := 0
if (keyIn3 == "Right")
whatBtn := 3
if (keyIn4 == "Right")
whatBtn := 4
if (keyIn5 == "Right")
whatBtn := 5
if (keyIn1 == "Right")
whatBtn := 1
if (keyIn2 == "Right")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
send {Right}
}
return
Joy1::
whatBtn := 0
if (keyIn3 == "Joy1")
whatBtn := 3
if (keyIn4 == "Joy1")
whatBtn := 4
if (keyIn5 == "Joy1")
whatBtn := 5
If (keyIn1 == "Joy1")
whatBtn := 1
if (keyIn2 == "Joy1")
whatBtn := 2
if (WhatBtn)
gosub, ScanAction
return
Joy2::
whatBtn := 0
if (keyIn3 == "Joy2")
whatBtn := 3
if (keyIn4 == "Joy2")
whatBtn := 4
if (keyIn5 == "Joy2")
whatBtn := 5
If (keyIn1 == "Joy2")
whatBtn := 1
if (keyIn2 == "Joy2")
whatBtn := 2
if (WhatBtn)
gosub, ScanAction
return
Joy3::
whatBtn := 0
if (keyIn3 == "Joy3")
whatBtn := 3
if (keyIn4 == "Joy3")
whatBtn := 4
if (keyIn5 == "Joy3")
whatBtn := 5
If (keyIn1 == "Joy3")
whatBtn := 1
if (keyIn2 == "Joy3")
whatBtn := 2
if (WhatBtn)
gosub, ScanAction
return
Joy4::
whatBtn := 0
if (keyIn3 == "Joy4")
whatBtn := 3
if (keyIn4 == "Joy4")
whatBtn := 4
if (keyIn5 == "Joy4")
whatBtn := 5
If (keyIn1 == "Joy4")
whatBtn := 1
if (keyIn2 == "Joy4")
whatBtn := 2
if (WhatBtn)
gosub, ScanAction
return
Joy5::
whatBtn := 0
If (keyIn1 == "Joy5")
whatBtn := 1
if (keyIn2 == "Joy5")
whatBtn := 2
if (keyIn3 == "{Joy5}")
whatBtn := 3
if (keyIn4 == "{Joy5}")
whatBtn := 4
if (keyIn5 == "{Joy5}")
whatBtn := 5
if (WhatBtn)
gosub, ScanAction
return
Joy6::
whatBtn := 0
if (keyIn3 == "Joy6")
whatBtn := 3
if (keyIn4 == "Joy6")
whatBtn := 4
if (keyIn5 == "Joy6")
whatBtn := 5
If (keyIn1 == "Joy6")
whatBtn := 1
if (keyIn2 == Joy6)
whatBtn := 2
if (WhatBtn)
gosub, ScanAction
return
Joy7::
whatBtn := 0
If (keyIn1 == "Joy7")
whatBtn := 1
if (keyIn2 == "Joy7")
whatBtn := 2
if (keyIn3 == "{Joy7}")
whatBtn := 3
if (keyIn4 == "{Joy7}")
whatBtn := 4
if (keyIn5 == "{Joy7}")
whatBtn := 5
if (WhatBtn)
gosub, ScanAction
return
Joy8::
whatBtn := 0
if (keyIn3 == "Joy8")
whatBtn := 3
if (keyIn4 == "Joy8")
whatBtn := 4
if (keyIn5 == "Joy8")
whatBtn := 5
If (keyIn1 == "Joy8")
whatBtn := 1
if (keyIn2 == "Joy8")
whatBtn := 2
if (WhatBtn)
gosub, ScanAction
return
$Lbutton::
whatBtn:= 0
if (keyIn3 == "LButton")
whatBtn := 3
if (keyIn4 == "LButton")
whatBtn := 4
if (keyIn5 == "LButton")
whatBtn := 5
if (keyIn1 == "LButton")
whatBtn := 1
if (keyIn2 == "LButton")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
Click
}
return
$Rbutton::
whatBtn:= 0
if (keyIn3 == "RButton")
whatBtn := 3
if (keyIn4 == "RButton")
whatBtn := 4
if (keyIn5 == "RButton")
whatBtn := 5
if (keyIn1 == "RButton")
whatBtn := 1
if (keyIn2 == "RButton")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
Click right
}
return
$Mbutton::
whatBtn:= 0
if (keyIn3 == "MButton")
whatBtn := 3
if (keyIn4 == "MButton")
whatBtn := 4
if (keyIn5 == "MButton")
whatBtn := 5
if (keyIn1 == "MButton")
whatBtn := 1
if (keyIn2 == "MButton")
whatBtn := 2
if (whatBtn)
{
goSub, scanAction
}
else
{
Click middle
}
return
pickSetup:
reloading = 1
gosub setVars
Gui, Destroy
gosub, reLoad
Return
loadSetupList:
menuList := ""
separator := "|"
lineItem := ""
loop, read, %iniF%
{
if inStr(A_LoopReadLine, "[")
{
StringTrimLeft, lineItem, A_LoopReadLine, 1
StringTrimRight, lineItem, lineItem, 1
menuList := menuList . separator . lineItem
}
}
StringTrimLeft, menuList, menuList, 1
SetupList := menuList
guiControl,,iniH, %iniH%|%SetupList%
reloading = 1
return
; Turn on/off help screen
showInfo:
if !(viewInfo)
{
Progress, m2 b2 w800 fs10 zh0 c00, %infoText%,,%infoTitle%
viewInfo = 1
}
else
{
Progress, Off
viewInfo = 0
}
Return
customHelp:
helpTitle = Custom Message Help
helpText = Specify custom messages for Key Sequences Sent by first entering text into the edit box below the Define Custom Key Sequences buttons, and then by clicking one of them. This sets the key sequence to the custom message. The custom message also appears at the bottom of the Key Seq. Sent menus. Special characters like enter and space have to be enclosed in braces as in {enter} and {space}. Send a left mouse click with {click} and right click with {click right}. For modifier keys use the following:`n ! sends Alt `n + sends Shift `n ^ sends Ctrl `n # sends Win `n For example: !{f4} sends Alt F4 `nMultiple charaters can be strung together. Refer to the Send command in Autohotkey help for more details.
msgBox,0,%helpTitle%,%helpText%
return
DoHelp:
msgBox,0,%helpTitle%,%helpText%
return
setCustom1:
Gui,Submit,NoHide
customMsg1 = %Custom%
Msg1 = %Custom%
guiControl,,Msg1,|%Msg1%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|{click 2}|%customMsg1%
goSub, saveIniSetup
return
setCustom2:
Gui,Submit,NoHide
customMsg2 = %Custom%
Msg2 = %Custom%
guiControl,,Msg2,|%Msg2%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|{click 2}|%customMsg2%
goSub, saveIniSetup
return
setCustom3:
Gui,Submit,NoHide
customMsg3 = %Custom%
Msg3 = %Custom%
guiControl,,Msg3,|%Msg3%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|{click 2}|%customMsg3%
goSub, saveIniSetup
return
setCustom4:
Gui,Submit,NoHide
customMsg4 = %Custom%
Msg4 = %Custom%
guiControl,,Msg4,|%Msg4%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|{click 2}|%customMsg4%
goSub, saveIniSetup
return
setCustom5:
Gui,Submit,NoHide
customMsg5 = %Custom%
Msg5 = %Custom%
guiControl,,Msg5,|%Msg5%||{Tab}|{Enter}|{Space}|{Right}|{Left}|{Up}|{Down}|+{Tab}|0|1|2|3|4|{click}|{click right}|{click 2}|%customMsg5%
goSub, saveIniSetup
return