-
Notifications
You must be signed in to change notification settings - Fork 10
/
EitherMouse.ahk
3051 lines (2781 loc) · 103 KB
/
EitherMouse.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
;================================================================================
;==
Name = EitherMouse
Version = 0.85
;==
;=== Multiple mice, individual settings...
;===== © 2009 - 2020 Steffen Software. All rights reserved.
;====== www.EitherMouse.com - gwarble@gmail.com
;================================================================================
;Beta = 1
Compile()
Update()
Instances:=Instance()
GoSub, CreateMenus
GoSub, Settings
GoSub, CreateCursors
GoSub, Hotkeys
GoSub, RegisterMice
GoSub, RegisterMessages
Return
;===================================================================================
;=== To do: ========================================================================
;===================================================================================
;- advanced gui with tabs/DDL for each mouse? all option/plugins? simple tray menu
;- open advanced gui and/or set settings from welcomegui?
;- tray icon & tooltip & timeout per mouse instead of global setting
;- colored cursors/load user cursors/mirrored cursors per mouse
;- check and show mouse poll rate? and cpi/dpi? device name?
;- add help to about? help gui? help doc? help site? help menu? help tooltips?
;- test rdp & vnc & vmware & vpc (old hotkey method of swapping?)
;- languages
;- touchpad/pen/trackball/etc icons & cursors, all windows cursor sets
;- reimplement proper cursor shadow with gdi+ if not window (and then add menu shadow)
;- scroll anywhere (hoverscroll)
;- ini option instead of registry? when names EitherMousePortable.exe?
;- hotkeys/options for quick change of settings, swap with tray icon?
;- if update time, check version to last recorded and still warn (if even newer?)
;Installer:
;- install for all users/current user
;- install without admin -> localappdata?
;- update within installer, or download new instead of using contained exe
;===================================================================================
;===================================================================================
;=== RawInput ======================================================================
;===================================================================================
WM_INPUT(w,l)
{
global
Critical
DllCall("GetRawInputData", uint, l, uint, 0x10000003, uint, 0, "uint*", sizeofraw, uint, 16)
VarSetCapacity(raw, sizeofraw, 0)
If (!DllCall("GetRawInputData",uint,l,uint,0x10000003,uint, &raw,"uint*",sizeofraw,uint,16,"int") or ErrorLevel)
Return 0
ThisMouse := NumGet(raw, 8)
If (ThisMouse = 0) && IgnoreZeroDevice
Return 0
If (LastMouse <> ThisMouse)
GoSub, MouseChange
Else If MultiCursor && MultiCursorTT
Loop, % MouseCount
If (MouseName(ThisMouse) = Mouse%A_Index%)
ToolTip, % Mouse%A_Index%Nick, , , % Mod(A_Index-1,20)+1
Return 0
}
;===================================================================================
;=== Mouse Change===================================================================
;===================================================================================
MouseChange:
If MultiCursor
{
MouseGetPos, X%ActiveMouse%, Y%ActiveMouse%
DeltaX%ActiveMouse% := NumGet(raw, (20+A_PtrSize*2), "Int")*4
DeltaY%ActiveMouse% := NumGet(raw, (24+A_PtrSize*2), "Int")*4
Mouse%ActiveMouse%X := X%ActiveMouse% - DeltaX%ActiveMouse%
Mouse%ActiveMouse%Y := Y%ActiveMouse% - DeltaY%ActiveMouse%
}
LastMouse := ThisMouse
Loop, % MouseCount
If (MouseName(ThisMouse) = Mouse%A_Index%)
{
LastActiveMouse := ActiveMouse
ActiveMouse := A_Index
If MultiCursor AND LastActiveMouse
BlankCursor()
MouseMove, % Mouse%ActiveMouse%X += DeltaX%LastActiveMouse%, % Mouse%ActiveMouse%Y += DeltaY%LastActiveMouse%, 0
If MultiCursorTT AND MultiCursor AND LastActiveMouse
ToolTip, % Mouse%ActiveMouse%Nick, , , % Mod(ActiveMouse-1,20)+1
SwapCursors( Mouse%A_Index%Cursor)
SwapButtons( Mouse%A_Index%Button)
SetSpeed( Mouse%A_Index%Speed)
SwapNav( Mouse%A_Index%Nav)
SwapRevScroll( Mouse%A_Index%RevScroll)
SwapRevHScroll( Mouse%A_Index%RevHScroll)
SwapClickLock( Mouse%A_Index%ClickLock)
SwapWheelClick( Mouse%A_Index%WheelClick)
SwapSnapTo( Mouse%A_Index%SnapTo)
SwapEpp( Mouse%A_Index%Epp)
SetDouble( Mouse%A_Index%Double)
SetWheel( Mouse%A_Index%Wheel)
If Icon = Number
SetTrayNumber(ActiveMouse)
Else
SwapIcon(Mouse%A_Index%Icon)
PostMessage, %WM_EitherMouse%,0,%ActiveMouse%,,ahk_id 0xFFFF
If GuiShown
GoSub, UpdateGui
If MultiCursor
{
If !(LastActiveMouse)
Return
xx%LastActiveMouse% := Mouse%LastActiveMouse%X<>""?Mouse%LastActiveMouse%X:Mouse%ActiveMouse%X
yy%LastActiveMouse% := Mouse%LastActiveMouse%Y<>""?Mouse%LastActiveMouse%Y:Mouse%ActiveMouse%Y
If (Mouse%LastActiveMouse%Cursor)
{
hArrow_ := hArrow
xx%LastActiveMouse% -= hArrowX
yy%LastActiveMouse% -= hArrowY
}
Else
{
hArrow_ := hArrowDefault
xx%LastActiveMouse% -= hArrowDefaultX
yy%LastActiveMouse% -= hArrowDefaultY
}
Gui, Cursor%ActiveMouse%:Hide
Gui, Cursor%LastActiveMouse%: +ToolWindow -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop +E0x20 +HwndHwnd%LastActiveMouse%
Gui, Cursor%LastActiveMouse%: Show, NA, % Name " cursor for " Mouse%LastActiveMouse%Nick
hbm := CreateDIBSection(CurSize, CurSize)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
DllCall("DrawIconEx", Ptr, hdc, "int", 0, "int", 0, Ptr, hArrow_, "uint", 32, "uint", 32, "uint", 0, Ptr, 0, "uint", 3)
UpdateLayeredWindow(Hwnd%LastActiveMouse%, hdc, 0, 0, CurSize, CurSize)
Gui, Cursor%LastActiveMouse%:Show, % "NA x" xx%LastActiveMouse% " y" yy%LastActiveMouse% " w" CurSize " h" CurSize
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
If (MultiCursorTime >= 0)
SetTimer, MultiCursorClose, % MultiCursorTime * (-1000)
}
Return
}
If !MouseCount
{
MouseCount++
Mouse%MouseCount% := MouseName(ThisMouse)
Mouse%MouseCount%Handle := ThisMouse
Mouse%MouseCount%Nick := "Mouse " MouseCount
Mouse%MouseCount%Button := Button?1:0
Mouse%MouseCount%Cursor := Button?1:0
Mouse%MouseCount%Speed := Speed
Mouse%MouseCount%Nav := 0
Mouse%MouseCount%RevScroll := 0
Mouse%MouseCount%RevHScroll := 0
Mouse%MouseCount%ClickLock := ClickLock
Mouse%MouseCount%WheelClick := 0
Mouse%MouseCount%SnapTo := SnapTo
Mouse%MouseCount%Epp := Epp
Mouse%MouseCount%Double := Double
Mouse%MouseCount%Wheel := Wheel
Mouse%MouseCount%Icon := Button?1:7
GuiControl, 13:, GuiText, % "First mouse detected..."
SetTimer, GuiShowTray, -200
}
Else
{
MouseCount++
Mouse%MouseCount% := MouseName(ThisMouse)
Mouse%MouseCount%Handle := ThisMouse
Mouse%MouseCount%Nick := "Mouse " MouseCount
Mouse%MouseCount%Button := Mouse%ActiveMouse%Button ="" ?Button :Mouse%ActiveMouse%Button
Mouse%MouseCount%Cursor := Mouse%ActiveMouse%Cursor ="" ?Button :Mouse%ActiveMouse%Cursor
Mouse%MouseCount%Speed := Mouse%ActiveMouse%Speed ="" ?Speed :Mouse%ActiveMouse%Speed
Mouse%MouseCount%Nav := Mouse%ActiveMouse%Nav ="" ?0 :Mouse%ActiveMouse%Nav
Mouse%MouseCount%RevScroll := Mouse%ActiveMouse%RevScroll ="" ?0 :Mouse%ActiveMouse%RevScroll
Mouse%MouseCount%RevHScroll := Mouse%ActiveMouse%RevHScroll="" ?0 :Mouse%ActiveMouse%RevHScroll
Mouse%MouseCount%ClickLock := Mouse%ActiveMouse%ClickLock ="" ?ClickLock :Mouse%ActiveMouse%ClickLock
Mouse%MouseCount%WheelClick := Mouse%ActiveMouse%WheelClick="" ?0 :Mouse%ActiveMouse%WheelClick
Mouse%MouseCount%SnapTo := Mouse%ActiveMouse%SnapTo ="" ?SnapTo :Mouse%ActiveMouse%SnapTo
Mouse%MouseCount%Epp := Mouse%ActiveMouse%Epp ="" ?Epp :Mouse%ActiveMouse%Epp
Mouse%MouseCount%Double := Mouse%ActiveMouse%Double ="" ?Double :Mouse%ActiveMouse%Double
Mouse%MouseCount%Wheel := Mouse%ActiveMouse%Wheel ="" ?Wheel :Mouse%ActiveMouse%Wheel
Mouse%MouseCount%Icon := Mouse%ActiveMouse%Icon =1 ?7 :1
If WelcomeGui
GuiControl, 13:, GuiText, % StringUpper(OrdinalNumber(Spell(MouseCount))) " mouse detected..."
}
GoSub, QuietSave
SetTimer, MouseChange, -10
SetTimer, GuiClose, -120000
Return
StringUpper(str) {
StringUpper,str,str,T
Return str
}
OrdinalNumber(n){
OrdinalNumber := {"one":"first", "two":"second", "three":"third", "five":"fifth", "eight":"eighth", "nine":"ninth", "twelve": "twelfth", "thirty": "thirtieth"}
RegExMatch(n, "\w+$", m)
return (OrdinalNumber[m] ? RegExReplace(n, "\w+$", OrdinalNumber[m]) : n "th")
}
Spell(n) { ; recursive function to spell out the name of a max 36 digit integer, after leading 0s removed
Static p1=" thousand ",p2=" million ",p3=" billion ",p4=" trillion ",p5=" quadrillion ",p6=" quintillion "
, p7=" sextillion ",p8=" septillion ",p9=" octillion ",p10=" nonillion ",p11=" decillion "
, t2="twenty",t3="thirty",t4="forty",t5="fifty",t6="sixty",t7="seventy",t8="eighty",t9="ninety"
, o0="zero",o1="one",o2="two",o3="three",o4="four",o5="five",o6="six",o7="seven",o8="eight"
, o9="nine",o10="ten",o11="eleven",o12="twelve",o13="thirteen",o14="fourteen",o15="fifteen"
, o16="sixteen",o17="seventeen",o18="eighteen",o19="nineteen"
n :=RegExReplace(n,"^0+(\d)","$1") ; remove leading 0s from n
If (11 < d := (StrLen(n)-1)//3) ; #of digit groups of 3
Return "Number too big"
If (d) ; more than 3 digits 1000+
Return Spell(SubStr(n,1,-3*d)) p%d% ((s:=SubStr(n,1-3*d)) ? ", " Spell(s) : "")
i := SubStr(n,1,1)
If (n > 99) ; 3 digits 100..999
Return o%i% " hundred" ((s:=SubStr(n,2)) ? " and " Spell(s) : "")
If (n > 19) ; n = 20..99
Return t%i% ((o:=SubStr(n,2)) ? "-" o%o% : "")
Return o%n% ; n = 0..19
}
PrettyNumber(n) { ; inserts thousands separators into a number string
Return RegExReplace( RegExReplace(n,"^0+(\d)","$1"), "\G\d+?(?=(\d{3})+(?:\D|$))", "$0,")
}
UpdateGui:
GuiControl,10:, Nick, % Mouse%ActiveMouse%Nick
If (MouseGUILastButton = "") OR (Mouse%A_Index%Button <> MouseGUILastButton)
{
MouseGUILastButton := Mouse%A_Index%Button
GuiControl,10:, ButtonCB, % Mouse%A_Index%Button
SetImage(hButtonPic, Mouse%A_Index%Button=0?hIconButtonL:hIconButtonR)
}
If (MouseGUILastCursor = "") OR (Mouse%A_Index%Cursor <> MouseGUILastCursor)
{
MouseGUILastCursor := Mouse%A_Index%Cursor
GuiControl,10:, CursorCB, % Mouse%A_Index%Cursor
SetImage(hCursorPic, Mouse%A_Index%Cursor=0?hIconCursorL:hIconCursorR)
}
If (MouseGUILastNav = "") OR (Mouse%A_Index%Nav <> MouseGUILastNav)
{
MouseGUILastNav := Mouse%A_Index%Nav
GuiControl,10:, NavCB, % Mouse%A_Index%Nav
SetImage(hNavPic, Mouse%A_Index%Nav=0?hIconNavL:hIconNavR)
}
If (MouseGUILastRevScroll = "") OR (Mouse%A_Index%RevScroll <> MouseGUILastRevScroll)
{
MouseGUILastRevScroll := Mouse%A_Index%RevScroll
GuiControl,10:, RevScrollCB, % Mouse%A_Index%RevScroll
}
If (MouseGUILastRevHScroll = "") OR (Mouse%A_Index%RevHScroll <> MouseGUILastRevHScroll)
{
MouseGUILastRevHScroll := Mouse%A_Index%RevHScroll
GuiControl,10:, RevHScrollCB, % Mouse%A_Index%RevHScroll
}
If (MouseGUILastClickLock = "") OR (Mouse%A_Index%ClickLock <> MouseGUILastClickLock)
{
MouseGUILastClickLock := Mouse%A_Index%ClickLock
GuiControl,10:, ClickLockCB, % Mouse%A_Index%ClickLock
}
If (MouseGUILastWheelClick = "") OR (Mouse%A_Index%WheelClick <> MouseGUILastWheelClick)
{
MouseGUILastWheelClick := Mouse%A_Index%WheelClick
GuiControl,10:, WheelClickCB, % Mouse%A_Index%WheelClick
}
If (MouseGUILastSnapTo = "") OR (Mouse%A_Index%SnapTo <> MouseGUILastSnapTo)
{
MouseGUILastSnapTo := Mouse%A_Index%SnapTo
GuiControl,10:, SnapToCB, % Mouse%A_Index%SnapTo
}
If (MouseGUILastEpp = "") OR (Mouse%A_Index%Epp <> MouseGUILastEpp)
{
MouseGUILastEpp := Mouse%A_Index%Epp
GuiControl,10:, EppCB, % Mouse%A_Index%Epp
}
If (MouseGUILastSpeed = "") OR (Mouse%A_Index%Speed <> MouseGUILastSpeed)
{
MouseGUILastSpeed := Mouse%A_Index%Speed
GuiControl,10:, MouseSpeed, % Mouse%A_Index%Speed
GuiControl,10:, MouseSpeedT, % "Mouse Speed: " Mouse%ActiveMouse%Speed
}
If (MouseGUILastWheel = "") OR (Mouse%A_Index%Wheel <> MouseGUILastWheel)
{
MouseGUILastWheel := Mouse%A_Index%Wheel
GuiControl,10:, Wheel, % Mouse%A_Index%Wheel
GuiControl,10:, WheelT, % "Scroll Wheel Speed: " Mouse%ActiveMouse%Wheel
}
If (MouseGUILastDouble = "") OR (Mouse%A_Index%Double <> MouseGUILastDouble)
{
MouseGUILastDouble := Mouse%A_Index%Double
GuiControl,10:, Double, % Mouse%A_Index%Double
GuiControl,10:, DoubleT, % "Double Click Speed: " Mouse%ActiveMouse%Double
}
Return
;===================================================================================
;=== Register Messages =============================================================
;===================================================================================
RegisterMessages:
OnResume()
OnMessage(0x404, "TrayClick")
OnMessage(WM_EitherMouse:=DllCall("RegisterWindowMessage",Str,"EitherMouse"),"WM_EitherMouse")
If (A_1 = "-show") OR (A_1 = "/show") OR ((Instances>1)) ; AND (Icon = "None..."))
SetTimer, GuiShowTray, -200
Return
WM_EitherMouse(W,L,M) {
global ActiveMouse
If (W = M)
Return %ActiveMouse%
}
OnResume(Label="OnResume",Delay=200,Msg="") {
static Init, Label_, Delay_
If !Init
{
DllCall("RegisterSuspendResumeNotification", "ptr", A_ScriptHwnd, "uint", 0)
DllCall( "Wtsapi32.dll\WTSRegisterSessionNotification", "uint", A_ScriptHwnd, "uint", 1 )
OnMessage(0x218, A_ThisFunc) ;WM_POWERBROADCAST
OnMessage(0x2B1, A_ThisFunc) ;WM_WTSSESSION_CHANGE
Label_ := Label
Delay_ := Delay
}
Init := 1
If !IsLabel(Label_)
Return
If (Msg = 0x218)
If (Label=0x7) OR (Label=0x8) OR (Label=0x18) ; PBT_APMRESUMESUSPEND=0x7, PBT_APMRESUMESTANDBY=0x8, PBT_APMRESUMEAUTOMATIC=0x18
SetTimer, %Label_%, -%Delay_%
If (Msg = 0x2B1)
If (Label=0x8) OR (Label=0x5) ; UNLOCK=0x8,LOGON=0x5
SetTimer, %Label_%, -%Delay_%
}
;===================================================================================
;=== Register Mice =================================================================
;===================================================================================
RegisterMice:
CoordMode, Mouse, Screen
VarSetCapacity(RawInputDevices, 12, 0)
NumPut(1, RawInputDevices, 0, "UShort")
NumPut(2, RawInputDevices, 2, "UShort")
NumPut(0x100, RawInputDevices, 4)
NumPut(A_ScriptHWnd, RawInputDevices, 8)
If (!DllCall("RegisterRawInputDevices",uint,&RawInputDevices,uint,1,uint,12) or ErrorLevel)
Return
OnMessage(0xFF, "WM_INPUT")
OnResume:
ActiveMouse := LastActiveMouse := 0
ThisMouse := LastMouse := ""
Menu, Tray, Icon, % A_ScriptName, 1
Return
;===================================================================================
;=== Settings ======================================================================
;===================================================================================
Settings:
RegRead, RunAsAdmin, HKCU, Software\%Name%\Defaults, RunAsAdmin
If RunAsAdmin
RunAsAdmin()
GuiH := 508
GuiW := 190
_16 := Round( 16 / dpi() )
_11 := Round( 11 / dpi() )
_96 := Round( 96 / dpi() )
CurSize := 32*dpi()
RegRead, Button, HKCU, Software\%Name%\Defaults, Button
RegRead, Cursor, HKCU, Software\%Name%\Defaults, Cursor
RegRead, Speed, HKCU, Software\%Name%\Defaults, Speed
RegRead, Double, HKCU, Software\%Name%\Defaults, Double
RegRead, Wheel, HKCU, Software\%Name%\Defaults, Wheel
RegRead, Icon, HKCU, Software\%Name%\Defaults, Icon
RegRead, Epp, HKCU, Software\%Name%\Defaults, Epp
RegRead, ClickLock, HKCU, Software\%Name%\Defaults, ClickLock
RegRead, SnapTo, HKCU, Software\%Name%\Defaults, SnapTo
RegRead, MultiCursor, HKCU, Software\%Name%\MultiCursor, MultiCursor
RegRead, MultiCursorTime, HKCU, Software\%Name%\MultiCursor, MultiCursorTime
RegRead, MultiCursorTT, HKCU, Software\%Name%\MultiCursor, MultiCursorTT
RegRead, MouseCount, HKCU, Software\%Name%, MouseCount
RegRead, UpdateVersion, HKCU, Software\%Name%, UpdateVersion
RegRead, UpdateChecked, HKCU, Software\%Name%, UpdateChecked
RegRead, IgnoreZeroDevice, HKCU, Software\%Name%, IgnoreZeroDevice
If (Button = "")
RegRead, Button, HKCU, Control Panel\Mouse, SwapMouseButtons
Cursor := ((Cursor = "") OR (Cursor = 7)) ? "Normal" : Cursor
Cursor := (Cursor = "ExtraLarge") ? "Extra Large" : Cursor
Cursor := (Cursor = "XP") ? "XP Style" : Cursor
Speed := (Speed = "") ? GetSpeed() : Speed
Double := (Double = "") ? GetDouble() : Double
Wheel := (Wheel = "") ? GetWheel() : Wheel
Icon := (Icon = "") OR (Icon = 1) ? "Logo" : Icon
Epp := (Epp = "") ? GetEpp() : Epp
ClickLock := (ClickLock = "") ? GetClickLock(): ClickLock
SnapTo := (SnapTo = "") ? GetSnapTo() : SnapTo
Nav := (Nav = "") ? 0 : Nav
MultiCursor := (MultiCursor = "") ? 0 : MultiCursor
MultiCursorTime := (MultiCursorTime = "") ? 60 : MultiCursorTime
MultiCursorTT := (MultiCursorTT = "") ? 0 : MultiCursorTT
IgnoreZeroDevice := (IgnoreZeroDevice = "") ? 1 : IgnoreZeroDevice
RunAsAdmin := (RunAsAdmin = "") ? 0 : RunAsAdmin
Loop, % MouseCount
{
RegRead, Mouse%A_Index%, HKCU, Software\%Name%\Mouse%A_Index%, Name
RegRead, Mouse%A_Index%Handle, HKCU, Software\%Name%\Mouse%A_Index%, Handle
RegRead, Mouse%A_Index%Nick, HKCU, Software\%Name%\Mouse%A_Index%, Nick
RegRead, Mouse%A_Index%Button, HKCU, Software\%Name%\Mouse%A_Index%, Button
RegRead, Mouse%A_Index%Cursor, HKCU, Software\%Name%\Mouse%A_Index%, Cursor
RegRead, Mouse%A_Index%Speed, HKCU, Software\%Name%\Mouse%A_Index%, Speed
RegRead, Mouse%A_Index%Nav, HKCU, Software\%Name%\Mouse%A_Index%, Nav
RegRead, Mouse%A_Index%RevScroll, HKCU, Software\%Name%\Mouse%A_Index%, RevScroll
RegRead, Mouse%A_Index%RevHScroll, HKCU, Software\%Name%\Mouse%A_Index%, RevHScroll
RegRead, Mouse%A_Index%ClickLock, HKCU, Software\%Name%\Mouse%A_Index%, ClickLock
RegRead, Mouse%A_Index%WheelClick, HKCU, Software\%Name%\Mouse%A_Index%, WheelClick
RegRead, Mouse%A_Index%SnapTo, HKCU, Software\%Name%\Mouse%A_Index%, SnapTo
RegRead, Mouse%A_Index%Epp, HKCU, Software\%Name%\Mouse%A_Index%, Epp
RegRead, Mouse%A_Index%Double, HKCU, Software\%Name%\Mouse%A_Index%, Double
RegRead, Mouse%A_Index%Wheel, HKCU, Software\%Name%\Mouse%A_Index%, Wheel
RegRead, Mouse%A_Index%Icon, HKCU, Software\%Name%\Mouse%A_Index%, Icon
Mouse%A_Index%Speed := (Mouse%A_Index%Speed = "") ? Speed : Mouse%A_Index%Speed
Mouse%A_Index%Double := ((Mouse%A_Index%Double = 0) OR (Mouse%A_Index%Double = "")) ? Double : Mouse%A_Index%Double
Mouse%A_Index%Wheel := ((Mouse%A_Index%Wheel = 0) OR (Mouse%A_Index%Wheel = "")) ? Wheel : Mouse%A_Index%Wheel
Mouse%A_Index%Epp := (Mouse%A_Index%Epp = "") ? Epp : Mouse%A_Index%Epp
Mouse%A_Index%RevScroll := (Mouse%A_Index%RevScroll = "") ? 0 : Mouse%A_Index%RevScroll
Mouse%A_Index%RevHScroll := (Mouse%A_Index%RevHScroll = "") ? 0 : Mouse%A_Index%RevHScroll
Mouse%A_Index%ClickLock := (Mouse%A_Index%ClickLock = "") ? ClickLock : Mouse%A_Index%ClickLock
Mouse%A_Index%WheelClick := (Mouse%A_Index%WheelClick = "") ? 0 : Mouse%A_Index%WheelClick
Mouse%A_Index%SnapTo := (Mouse%A_Index%SnapTo = "") ? SnapTo : Mouse%A_Index%SnapTo
}
If MultiCursor
pToken := Gdip_Startup()
Menu, Configure, Icon, Tray Icon:, %A_ScriptName%,1,16
Menu, Cursors, Default, % Cursor
Menu, Tray, Icon, % A_ScriptName, 1
If (Icon <> "None...")
{
Menu, Icons, Default, % Icon
Menu, Tray, Icon
}
IfExist, %A_StartupCommon%\%Name%.lnk
{
FileDelete, %A_Startup%\%Name%.lnk
FileDelete, %A_StartupCommon%\%Name%.lnk
FileCreateShortcut, "%A_ScriptFullPath%", %A_Startup%\%Name%.lnk
}
If (UpdateChecked <> "Skip")
SetTimer, UpdateCheckQuiet, -10000
Menu, Advanced, % IgnoreZeroDevice?"Check":"UnCheck", Ignore Zero Device
A_1 = %1%
If (A_1 = "-silent") OR (A_1 = "/silent")
Return
If MouseCount
Return
WelcomeGui = 1
Gui, 13:-ToolWindow -Caption +Border
Gui 13:+LastFound
Gui, 13:Add, Button, x75 y190 w105 h30 Center vGuiCloseButton AltSubmit gGuiClose , OK
Gui, 13:Add, Picture, x246 y3 w%_11% h%_11% vGuiClose AltSubmit gGuiClose Icon19, %A_ScriptName%
Gui, 13:Add, Text, x-1 y-1 w270 h242 Center BackgroundTrans GuiMove
Gui, 13:Add, Picture, x6 y8 w48 h48 Icon1 GuiMove vName___, % A_ScriptName
Gui, 13:Font, s16 w600 cBlack
Gui, 13:Add, Text, x15 y20 w238 h30 Center BackgroundTrans GuiMove vName, %Name%
Gui, 13:Font, s10 w0
Gui, 13:Add, Text, x0 y63 w268 Center BackgroundTrans GuiMove vGuiDesc, % "Multiple mice, individual settings."
Gui, 13:Font, s10 w600
Gui, 13:Add, Text, x0 y98 w268 Center BackgroundTrans GuiMove vGuiText, % "Move the primary mouse now...`n"
Gui, 13:Font, s10 w0
Gui, 13:Add, Text, x0 y135 w268 Center BackgroundTrans GuiMove, % "Each mouse can be configured`nfrom the system tray once detected..."
Gui, 13:Show, w260 h240, %Name% %Version%
OnExit, OnExit
SetTaskbarProgress("I")
SetTimer, GuiClose, 120000
SetTimer, IconFlash, 400
Sleep, 750
Return
IconFlash:
IconFlash := !IconFlash
Menu, Tray, Icon, % A_ScriptName, % IconFlash + 6
Return
ToggleRunAsAdmin:
RunAsAdmin := !RunAsAdmin
If RunAsAdmin
{
Menu, Advanced, Check, Run As Administrator
GoSub, QuietSave
If !A_IsAdmin
Run, "%A_ScriptFullPath%" -show %X_% %Y_%, , UseErrorLevel
}
Else
Menu, Advanced, Uncheck, Run As Administrator
GoSub, QuietSave
Return
;===================================================================================
;==== Saving =======================================================================
;===================================================================================
QuietSave:
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, Button, % Button
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, Cursor, % Cursor
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, Speed, % Speed
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, Double, % Double
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, Wheel, % Wheel
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, Icon, % Icon
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, Epp, % Epp
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, ClickLock, % ClickLock
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, SnapTo, % SnapTo
RegWrite, REG_SZ, HKCU, Software\%Name%\Defaults, RunAsAdmin, % RunAsAdmin
RegWrite, REG_SZ, HKCU, Software\%Name%\MultiCursor, MultiCursor, % MultiCursor
RegWrite, REG_SZ, HKCU, Software\%Name%\MultiCursor, MultiCursorTime, % MultiCursorTime
RegWrite, REG_SZ, HKCU, Software\%Name%\MultiCursor, MultiCursorTT, % MultiCursorTT
RegWrite, REG_SZ, HKCU, Software\%Name%, MouseCount, % MouseCount
Loop, % MouseCount
{
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Name, % Mouse%A_Index%
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Handle, % Mouse%A_Index%Handle
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Nick, % Mouse%A_Index%Nick
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Button, % Mouse%A_Index%Button
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Cursor, % Mouse%A_Index%Cursor
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Speed, % Mouse%A_Index%Speed
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Nav, % Mouse%A_Index%Nav
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, RevScroll, % Mouse%A_Index%RevScroll
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, RevHScroll, % Mouse%A_Index%RevHScroll
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, ClickLock, % Mouse%A_Index%ClickLock
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, WheelClick, % Mouse%A_Index%WheelClick
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, SnapTo, % Mouse%A_Index%SnapTo
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Epp, % Mouse%A_Index%Epp
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Double, % Mouse%A_Index%Double
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Wheel, % Mouse%A_Index%Wheel
RegWrite, REG_SZ, HKCU, Software\%Name%\Mouse%A_Index%, Icon, % Mouse%A_Index%Icon
}
Return
;===================================================================================
;==== Exiting ======================================================================
;===================================================================================
OnExit:
SwapButtons(Button)
SwapCursors(0)
SetSpeed(Speed)
SetEpp(Epp)
SetDouble(Double)
SetWheel(Wheel)
If pToken
pToken := Gdip_Shutdown(pToken)
Exit:
ExitApp:
-ExitApp:
ExitApp
ClearAllSettings:
RegDelete, HKCU, Software\%Name%
GoSub, SystemDefaults
GoSub, Settings
OnMessage(0xFF, "WM_INPUT")
DoNothing:
Return
-ClearAllSettings:
-Clear:
RegDelete, HKCU, Software\%Name%
Run, "%A_ScriptFullPath%" -exit, , UseErrorLevel
ExitApp
MouseSettings:
GoSub, SystemDefaults
RunWait, control mouse, , UseErrorLevel
OnMessage(0xFF, "WM_INPUT")
Return
SystemDefaults:
GoSub, GuiClose
GoSub, MenuClose
GoSub, MultiCursorClose
SwapButtons(Button)
SwapCursors(0)
SetSpeed(Speed)
SetEpp(Epp)
SetClickLock(ClickLock)
SetSnapTo(SnapTo)
SetDouble(Double)
SetWheel(Wheel)
SwapRevScroll(0)
SwapRevHScroll(0)
SwapWheelClick(0)
If pToken
pToken := Gdip_Shutdown(pToken)
ThisMouse := LastMouse := ""
MouseCount := 0
OnMessage(0xFF, "")
ToolTip
Return
;===================================================================================
;=== Cursors =======================================================================
;===================================================================================
CursorsNormal:
Cursor=Normal
Menu, Cursors, Default, Normal
GoSub, CursorChange
Return
CursorsLarge:
Cursor=Large
Menu, Cursors, Default, Large
GoSub, CursorChange
Return
CursorsExtraLarge:
Cursor=Extra Large
Menu, Cursors, Default, Extra Large
GoSub, CursorChange
Return
Cursors8:
Cursor=Windows 8 Style
Menu, Cursors, Default, Windows 8 Style
GoSub, CursorChange
Return
;Cursors10:
; Cursor=Windows 10 Style
; Menu, Cursors, Default, Windows 10 Style
; GoSub, CursorChange
;Return
CursorsXP:
Cursor=XP Style
Menu, Cursors, Default, XP Style
GoSub, CursorChange
Return
Cursors98:
Cursor=98 Style
Menu, Cursors, Default, 98 Style
GoSub, CursorChange
Return
CursorsNone:
MsgBox, 68, %Name%, Do you really want to set the cursor to 'None...'`n`nYou will not be able to see your mouse cursor!
IfMsgBox, Yes
{
Cursor=None
Menu, Cursors, Default, None...
GoSub, CursorChange
}
Return
CursorChange:
GoSub, CreateCursors
GoSub, MouseChange
GoSub, QuietSave
Return
CreateDefaultCursor:
hArrowDefault_ := DllCall( "LoadCursor", Uint,0, Int, 32512 )
hArrowDefault := DllCall("CopyImage",uint, hArrowDefault_, uint,2,int,0,int,0,uint,0)
VarSetCapacity(IconInfoStruct, 17, 0)
DllCall("GetIconInfo", "Uint", hArrowDefault_, "Uint", &IconInfoStruct)
hArrowDefaultX := NumGet(IconInfoStruct, 4)
hArrowDefaultY := NumGet(IconInfoStruct, 8)
Return
CreateCursors:
GoSub, CreateDefaultCursor
VarSetCapacity(IconInfoStruct, 17, 0)
hModule := DllCall("GetModuleHandle", Ptr, 0)
If Cursor = XP Style
LoadCursors("XP")
Else If Cursor = 98 Style
LoadCursors("98")
Else If Cursor = Windows 8 Style
LoadCursors("8")
Else If Cursor = Large
LoadCursors("L")
Else If Cursor = Extra Large
LoadCursors("XL")
Else If Cursor = None
LoadCursors("7")
Else
LoadCursors("7")
Return
LoadCursors(Style) {
global
str=ARROW%Style%
hArrow := DllCall( "LoadCursor", Uint,hModule, Int, &str )
DllCall("GetIconInfo", "Uint", hArrow, "Uint", &IconInfoStruct)
hArrowX := NumGet(IconInfoStruct, 4)
hArrowY := NumGet(IconInfoStruct, 8)
str=ARROWR%Style%
hArrowR := DllCall( "LoadCursor", Uint,hModule, Int, &str )
DllCall("GetIconInfo", "Uint", hArrowR, "Uint", &IconInfoStruct)
hArrowRX := NumGet(IconInfoStruct, 4)
hArrowRY := NumGet(IconInfoStruct, 8)
str=START%Style%
hStart := Resource_Read_AniCursor(str)
str=HAND%Style%
hHand := DllCall( "LoadCursor", Uint,hModule, Int, &str )
str=HELP%Style%
hHelp := DllCall( "LoadCursor", Uint,hModule, Int, &str )
Return
}
SystemCursor(Which,With="") {
global
If Which = Arrow
WhichID = 32512
Else If Which = Hand
WhichID = 32649
Else If Which = Start
WhichID = 32650
Else If Which = Help
WhichID = 32651
Else
Return
If (Which = "Start")
hCursor := hStart
Else
hCursor := DllCall("CopyImage",uint, h%Which%, uint,2,int,0,int,0,uint,0)
DllCall("SetSystemCursor",Uint,hCursor,Int,WhichID)
Return
}
RestoreCursors() {
Return DllCall("SystemParametersInfo",UInt,0x57,UInt,0,UInt,0,UInt,0)
}
LoadCustomCursors:
Loop, %MouseCount%
{
Notify("Select a cursor for Mouse " A_Index)
FileSelectFile, Cur%A_Index%, Select a cursor for Mouse %A_Index%
}
Return
;===================================================================================
;=== MultiCursor ===================================================================
;===================================================================================
ToggleMultiCursor:
MultiCursor := !MultiCursor
If MultiCursor
{
GuiControl,10:, MultiCursor, 1
GuiControl,10:Enable,MultiCursorTT
GuiControl,10:Enable,MultiCursorTimeE
GuiControl,10:Enable,MultiCursorTimeT
If !pToken
pToken := Gdip_Startup()
}
Else
{
GuiControl,10:, MultiCursor, 0
GoSub, MultiCursorClose
GuiControl,10:Disable,MultiCursorTT
GuiControl,10:Disable,MultiCursorTimeE
GuiControl,10:Disable,MultiCursorTimeT
If pToken
pToken := Gdip_Shutdown(pToken)
}
GoSub, QuietSave
Return
ToggleMultiCursorTT:
MultiCursorTT := !MultiCursorTT
If MultiCursorTT
GuiControl,10:, MultiCursorTT, 1
Else
{
GuiControl,10:, MultiCursorTT, 0
GoSub, MultiCursorClose
}
GoSub, QuietSave
Return
MultiCursorClose:
Loop, %MouseCount%
{
Gui, Cursor%A_Index%:Destroy ;Hide
ToolTip, , , , % Mod(A_Index-1,20)+1
}
Return
;===================================================================================
;=== Tray Icon =====================================================================
;===================================================================================
SelectIcon:
LastIcon := Icon
Icon := A_ThisMenuItem
If Icon = None...
{
SelectIcon0 := 7, SelectIcon1 := 1
Notify("The tray icon has been set to 'None...'`nTo access the configuration menu again,`nre-launch EitherMouse...", , 30, "GC=9aeffb BW=1 BT=255 IN=1 IW=48 IH=48 AX=1 Image=" A_ScriptName)
Menu, Tray, NoIcon
}
Else If Icon = Custom...
{
SelectIcon0 := 7, SelectIcon1 := 1
FileSelectFile, _file
Menu, Tray, Icon, %_file%
If LastIcon = None...
Menu, Tray, Icon
}
Else
{
If LastIcon = None...
Menu, Tray, Icon
If A_ThisMenuItem = Logo
SelectIcon0 := 7, SelectIcon1 := 1
Else If A_ThisMenuItem = Mouse
SelectIcon0 := 9, SelectIcon1 := 8
Else If A_ThisMenuItem = Blue Arrow
SelectIcon0 := 3, SelectIcon1 := 2
Else If A_ThisMenuItem = Red Arrow
SelectIcon0 := 5, SelectIcon1 := 4
Loop, %MouseCount%
{
If A_ThisMenuItem = Cursor
If Mouse%A_Index%Cursor = 0
Mouse%A_Index%Icon := 11
Else
Mouse%A_Index%Icon := 10
Else
If Mouse%A_Index%Button = 0
Mouse%A_Index%Icon := SelectIcon0
Else
Mouse%A_Index%Icon := SelectIcon1
}
If Icon = Number
SetTrayNumber(ActiveMouse)
Else
SwapIcon(Mouse%ActiveMouse%Icon)
}
Menu, Icons, Default, % Icon
Menu, Configure, Icon, Tray Icon:, %A_ScriptName%,% Mouse%ActiveMouse%Icon,16
GoSub, QuietSave
Return
;===================================================================================
;=== Menus =========================================================================
;===================================================================================
CreateMenus:
Menu, Tray, NoStandard
Menu, Tray, UseErrorLevel
Menu, Cursors, Add, Normal, CursorsNormal
Menu, Cursors, Default, Normal
Menu, Cursors, Add, Large, CursorsLarge
Menu, Cursors, Add, Extra Large, CursorsExtraLarge
Menu, Cursors, Add
Menu, Cursors, Add, Windows 8 Style, Cursors8
Menu, Cursors, Add, Windows 10 Style, Cursors10
Menu, Cursors, Add
Menu, Cursors, Add, XP Style, CursorsXP
Menu, Cursors, Add, 98 Style, Cursors98
Menu, Cursors, Icon, Normal, %A_ScriptName%,10,16
Menu, Cursors, Icon, Large, %A_ScriptName%,10,24
Menu, Cursors, Icon, Extra Large, %A_ScriptName%,10,32
Menu, Cursors, Icon, Windows 8 Style, %A_ScriptName%,32,24
Menu, Cursors, Icon, XP Style, %A_ScriptName%,30,24
Menu, Cursors, Icon, 98 Style, %A_ScriptName%,31,24
If Beta
{
Menu, Cursors, Add
Menu, Cursors, Add, Custom..., LoadCustomCursors
Menu, Cursors, Icon, Custom..., %A_ScriptName%,20,16
Menu, Cursors, Add, None..., CursorsNone
Menu, Cursors, Icon, None..., %A_ScriptName%,36,16
}
Menu, Icons, Add, Logo, SelectIcon
; Menu, Icons, Default, Logo
Menu, Icons, Add, Mouse, SelectIcon
Menu, Icons, Add, Cursor, SelectIcon
Menu, Icons, Add, Blue Arrow, SelectIcon
Menu, Icons, Add, Red Arrow, SelectIcon
Menu, Icons, Add, Number, SelectIcon
Menu, Icons, Add
If Beta
{
Menu, Icons, Add, Custom..., SelectIcon
Menu, Icons, Icon, Custom..., %A_ScriptName%,20,16
}
Menu, Icons, Add, None..., SelectIcon
Menu, Icons, Icon, None..., %A_ScriptName%,36,16
Menu, Icons, Icon, Logo, %A_ScriptName%,1,16
Menu, Icons, Icon, Mouse, %A_ScriptName%,8,16
Menu, Icons, Icon, Cursor, %A_ScriptName%,10,16
Menu, Icons, Icon, Blue Arrow, %A_ScriptName%,2,16
Menu, Icons, Icon, Red Arrow, %A_ScriptName%,4,16
Menu, Icons, Icon, Number, %A_ScriptName%,28,16
Menu, Configure, Add, Start with Windows, ToggleStartWithWindows
Menu, Configure, Icon, Start with Windows, %A_ScriptName%,37,16
Menu, Configure, Add, Cursors:, :Cursors
Menu, Configure, Icon, Cursors:, %A_ScriptName%,10,16
Menu, Configure, Add, Tray Icon:, :Icons
Menu, Configure, Icon, Tray Icon:, %A_ScriptName%,1,16
Menu, Configure, Add
Menu, Updates, Add, Automatically update..., UpdateCheckAuto
; Menu, Updates, Disable, Automatically update...
Menu, Updates, Add, Check for updates and notify me..., UpdateCheckQuietMenu
Menu, Updates, Add, Never check for updates..., UpdateCheckSkip
Menu, Updates, Add
Menu, Updates, Add, Update %Name% now..., UpdateNow
Menu, Updates, Add, Check for an update now..., UpdateCheck
Menu, Updates, Add, Download latest Installer now..., UpdateInstaller
RegRead, UpdateChecked, HKCU, Software\%Name%, UpdateChecked
If (UpdateChecked = "Skip")
Menu, Updates, Check, Never check for updates...
Else If (UpdateChecked = "Auto")
Menu, Updates, Check, Automatically update...
Else
Menu, Updates, Check, Check for updates and notify me...
Menu, Advanced, Add, Clear all settings..., ClearAllSettings
Menu, Advanced, Icon, Clear all settings..., %A_ScriptName%,35,16
Menu, Advanced, Add, Run As Administrator, ToggleRunAsAdmin
Menu, Advanced, Icon, Run As Administrator, %A_ScriptName%,33,16
Menu, Advanced, Add
Menu, Advanced, Add, Mouse Control Panel..., MouseSettings
Menu, Advanced, Icon, Mouse Control Panel..., %A_ScriptName%,27,16
If (A_ScriptDir <> A_ProgramFiles "\" Name)
{
Menu, Advanced, Add, Install to Program Files..., InstallToProgramFiles
Menu, Advanced, Icon, Install to Program Files..., %A_ScriptName%,4,16
}
Menu, Advanced, Add
Menu, Advanced, Add, Ignore Zero Device, ToggleIgnoreZeroDevice
Menu, Advanced, Icon, Ignore Zero Device, %A_ScriptName%,37,16
Menu, Configure, Add, Advanced:, :Advanced
Menu, Configure, Icon, Advanced:, %A_ScriptName%,21,16
Menu, Configure, Add, Updates:, :Updates
Menu, Configure, Icon, Updates:, %A_ScriptName%,3,16
Menu, Configure, Add
Menu, Configure, Add, About..., About
Menu, Configure, Icon, About..., %A_ScriptName%,20,16
Menu, Configure, Add, Exit, ExitApp
Menu, Configure, Icon, Exit, %A_ScriptName%,36,16
Menu, Tray, Tip, % " " Name " " Version (Beta?" Beta ":" ")
Return
ShowConfigMenu:
Menu_Show("Configure")
Return
ShowTrayIconMenu: