Advertisement
MrFace1

Ctrl CapsLock Menu (new, ctrl capslock capslock now - removed ctrl shift capslock)

Mar 9th, 2023 (edited)
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 23.79 KB | Source Code | 0 0
  1. /* (!)(A) ctrl capslock MENU.ahk */
  2.  
  3.  
  4. ;\/\/\/\/\/\/
  5. ;CTRL+CAPSLOCK to activate the menu
  6. ;
  7. ;CTRL+SHIFT+CAPSLOCK to send Ctrl A before activating the menu, to select all text first.
  8. ;/\/\/\/\/\/\/\
  9.  
  10.  
  11. /*
  12.  
  13. ===SETTINGS===
  14.  
  15. Dark mode on by default:
  16.   - Ctrl F this: MenuDark(Dark:=4)
  17.   - Change the 4 to a 2
  18.   - (The other numbers dont do anything different)
  19.  
  20. */
  21.  
  22.  
  23.  
  24.  
  25. /*
  26. README:
  27.  
  28. This is my first time making a script like this. I dont want to admit how much time I put into this, but lets just say it was a lot.
  29. Most of the code here is copy and pasted from other sources, I mainly just fit everyting together.
  30. I wasnt the one who made the lego bricks, but I was the one who jammed them all together, even when they didnt really feel like they would fit.
  31. ...which is why some things might seem a little scattered and unorginized - (I am not a coder)
  32.  
  33. =
  34. I was inspired to make this after using u/S3rLoG's capslock menu. It was really good.
  35. But his first script had this AWESOME loading bar GUI but he ended up removing it in later versions. ██████████████]99%
  36. I understand why he removed it (it was useless), but the loading bar gui had so much personality, idk why but I really missed it when it was removed.
  37. So that is why Ive decided to keep it alive through an easter egg in the menu.........
  38. =
  39.  
  40. BTW if youre into this kind of thing, definitely check out u/S3rLoG's current script. Its jampacked with a lot of cool features!   ->     (https://www.reddit.com/r/AutoHotkey/comments/m0ijbo/capslock_menu/)
  41. However, my goal with this was to make a more precise menu, only including things that I think are necessary/close to the necessary side of the spectrum.
  42.  
  43.  
  44.  
  45. Feel free to move around the options or add your own options, its actually extremely simple:
  46. You just google 'ahk how do i make selected text uppercase/lowercase/have quotes/whatever' and then replace the word (ctrl H) clipboard with TempText and get rid of the ^c/^x at the beggining and ^v at the end
  47.  
  48.  
  49.  
  50.  
  51. =================================(Read below for instructions on how to add your own buttons to this script)=================================
  52.  
  53. ___Heres how google says to add quotes to text:
  54.  
  55.     Send ^x
  56.  
  57.     Sleep, 100
  58.  
  59.     ClipWait
  60.  
  61.     Clipboard="%Clipboard%"
  62.  
  63.     Sleep, 100
  64.  
  65.     ClipWait
  66.  
  67.     Send ^v
  68.  
  69.     return
  70.  
  71.  
  72. ___Heres how it would be done in this script:
  73.  
  74.     Case "&Quotes":
  75. ;Send ^x
  76.  
  77. ;Sleep, 100
  78.  
  79. ;ClipWait
  80.  
  81.     TempText="%TempText%"
  82.  
  83. ;Sleep, 100
  84.  
  85. ;ClipWait
  86.  
  87. ;Send ^v
  88.  
  89. ;return
  90.  
  91.  
  92.  
  93. How this script works is it copies the text, changes it, then pastes it.
  94. But this script has a built in thing where it automatically copies the text when you open the menu, and automatically pastes it once the text is changed, so all you need to add is how the copied text (TempText) gets changed
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. __(Further clarification):
  106.  
  107.  
  108. !!!!! If you have a case where you DONT want TempText to be pasted (like for the date Case), just put Exit at the end of it.
  109.  
  110.  
  111. You could use that first code and it would work fine, just as long as you put Exit at the end of it so it Exits the process instead of continuing down and pasting TempText (putting Exit makes it not paste TempText)
  112.  
  113.  
  114. ___This would be totally fine and work totally fine without issue:
  115.  
  116.  
  117.     Case "&Quotes":
  118.     Send ^x
  119.  
  120.     Sleep, 100
  121.  
  122.     ClipWait
  123.  
  124.     Clipboard="%Clipboard%"
  125.  
  126.     Sleep, 100
  127.  
  128.     ClipWait
  129.  
  130.     Send ^v
  131.  
  132.     return
  133.    
  134.     Exit  ;<------Add this at the end IF YOU DONT USE TEMPTEXT
  135.  
  136.  
  137.  
  138.  
  139. To add/change position of buttons, Scroll down
  140. To see where the actual Cases get called, Scroll down even further
  141. */
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158. ;;;;;;; DARK MODE ;;;;;;; Change the values below to change the color of the menu.
  159.  
  160.  
  161. DarkMode := false ; set initial mode to light
  162.  
  163.  
  164.  
  165. MenuDark()
  166.  
  167. ; 0=Default  1=AllowDark  2=ForceDark  3=ForceLight  4=Max
  168.  
  169. MenuDark(Dark:=4) {      ;<=--------------------------------------------------------------<=CHANGE DEFAULT TO DARK MODE (make it the default)
  170.     ;https://stackoverflow.com/a/58547831/894589
  171.     static uxtheme := DllCall("GetModuleHandle", "str", "uxtheme", "ptr")
  172.     static SetPreferredAppMode := DllCall("GetProcAddress", "ptr", uxtheme, "ptr", 135, "ptr")
  173.     static FlushMenuThemes := DllCall("GetProcAddress", "ptr", uxtheme, "ptr", 136, "ptr")
  174.  
  175.     DllCall(SetPreferredAppMode, "int", Dark) ; 0=Default  1=AllowDark  2=ForceDark  3=ForceLight  4=Max
  176.     DllCall(FlushMenuThemes)
  177. }
  178.  
  179.  
  180. ;;;;;;;;;;;;;;;;;;;;;;;;;
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. #NoEnv
  188. SendMode Input
  189. SetWorkingDir %A_ScriptDir%
  190. #SingleInstance Force
  191. SetTitleMatchMode 2
  192. SetBatchLines -1  ; Run the script at maximum speed
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. GroupAdd All
  201.  
  202. Menu Case, Add, CAPSLOCK MENU, CCase
  203. Menu, Case, Default, CAPSLOCK MENU        ;makes bold
  204. Menu Case, Add   
  205. Menu Case, Add, UPPERCASE        &1, CCase         ; '&' symbol makes pressing 1 activate this option
  206. Menu Case, Add, lowercase            &2, CCase
  207. Menu Case, Add, Title Case             &3, CCase
  208. Menu Case, Add, Sentence case     &4, CCase
  209. Menu Case, Add             
  210. Menu Case, Add,...″   &Q, CCase
  211. Menu Case, Add, '...'    &W, CCase
  212. Menu Case, Add, (...)    &E, CCase
  213. Menu Case, Add
  214.  
  215. ;
  216.    
  217. Menu More, Add, `{...}    &A, CCase
  218. Menu More, Add, `*...*    &S, CCase
  219. Menu More, Add 
  220. Menu More, Add, &Date - 06/07/04, CCase
  221. Menu More, Add
  222. Menu More, Add, iNVERT cASE, CCase
  223. Menu More, Add, SpOnGeBoB cAsE, CCase
  224. Menu More, Add, S p r e a d T e x t, CCase
  225. Menu More, Add, raNDoM cASE, CCase
  226. Menu More, Add, Reverse, CCase
  227. Menu More, Add
  228. Menu More, Add
  229. Menu, More, Add, Dark Mode | Light Mode, CCase
  230.  
  231.  
  232. Menu Case, Add, &A - More Options, :More
  233.  
  234.  
  235. ;
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243. ;press ctrl capslock, show menu
  244. ;press ctrl capslock capslock, send ctrl a, then show menu
  245.  
  246.  
  247.  
  248. ;crdit to u/ExpiredDebitCard for this code
  249. #If GetKeyState("Ctrl","P")  ;Activate hotkey(s) below if True
  250. *CapsLock::                  ;Trigger Key
  251.   KeyWait CapsLock,T.2       ;  Wait time (200ms)
  252.   If !ErrorLevel{            ;  If released before wait time
  253.     KeyWait CapsLock,D T.1   ;    Second press within 100ms?
  254.     If !ErrorLevel {           ;    If second press detected
  255.  
  256.     sleep 100
  257.     send ^a          ;<=-------send ^a, to select all text
  258.     sleep 200
  259.     GetText(TempText)
  260.     Menu Case, Show  ;<=-------Then show capslock menu
  261.  
  262.           }
  263.     Else {                     ;    Otherwise
  264.        
  265.       GetText(TempText)
  266.       Menu Case, Show    ;<=------------------NORMAL Show capslock menu
  267.  
  268.     } }
  269. Return                       ;All done
  270. #If                          ;Don't affect following hotkeys
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278. ;ignore (old)
  279.  
  280. /*
  281. ^CapsLock::    ;<=---------------------------------------MAIN SHORTCUT HERE (ctrl capslock)
  282.    GetText(TempText)
  283.    Menu Case, Show  ;<=----------------------------------Show capslock menu
  284. Return
  285.  
  286.  
  287. ^+capslock::    ;<=---(ctrl SHIFT capslock)
  288.     sleep 100
  289.     send ^a          ;<=-------send ^a, to select all text
  290.     sleep 200
  291.     GetText(TempText)
  292.     Menu Case, Show  ;<=-------Then show capslock menu
  293. return
  294. */
  295.  
  296. ;===;
  297.  
  298. ;ignore (old)
  299. /*
  300. If (fCtrl2) {
  301.     sleep 100
  302.     send ^a
  303.     sleep 300
  304.     }
  305. */
  306.  
  307.  
  308. ;;;If ERRORLEVEL {   ;<=---IF NO TEXT IS SELECTED,
  309. ;;;If NOT ERRORLEVEL  ;IF TEXT IS SELECTED,
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318. ;btw TempText is just whats been selected/copied
  319. ;Exit
  320. ;Exit to exit
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327. ;;;;;;;;;;;;;;;;;; THE STUFF ;;;;;;;;;;;;;;;;;;; <=============================================================================================================
  328.  
  329. CCase:
  330.  Switch A_ThisMenuItem {
  331.  
  332.  
  333.  
  334.     Case "CAPSLOCK MENU":
  335.     LoadingBar()
  336.  
  337.     Case "UPPERCASE        &1":
  338.       StringUpper, TempText, TempText
  339.  
  340.     Case "lowercase            &2":
  341.       StringLower, TempText, TempText
  342.  
  343.     Case "Title Case             &3":
  344.       StringLower, TempText, TempText, T
  345.  
  346.     Case "Sentence case     &4":
  347.       StringLower, TempText, TempText
  348.       TempText := RegExReplace(TempText, "((?:^|[.!?]\s+)[a-z])", "$u1")
  349.  
  350.  
  351. ;__________________________________________________________________________________________________
  352.  
  353.     Case "″...″   &Q":
  354.       TempText := RegExReplace(TempText, "\s+$")   ;gets rid of whitespace at end (ChatGPT)
  355.       TempText := """" TempText """"
  356.  
  357.     Case "'...'    &W":
  358.         TempText := RegExReplace(TempText, "\s+$")   ;gets rid of whitespace at end
  359.     TempText := "'" TempText "'"
  360.  
  361.     Case "(...)    &E":
  362.       TempText := RegExReplace(TempText, "\s+$")   ;gets rid of whitespace at end
  363.       TempText := "(" TempText ")"
  364.  
  365. ;-----More Options--------------------------
  366.  
  367.     Case "`{...}    &A":
  368.       TempText := RegExReplace(TempText, "\s+$")   ;gets rid of whitespace at end
  369.       TempText := "{" TempText "}"
  370.  
  371.     Case "`*...*    &S":
  372.       TempText := RegExReplace(TempText, "\s+$")   ;gets rid of whitespace at end
  373.       TempText := "*" TempText "*"
  374.  
  375. ;-------------
  376.  
  377. Case "&Date - 06/07/04":
  378.       FormatTime, CurrentDateTime,,MM/dd/yy ; - hh:mmtt
  379.       SendInput %CurrentDateTime%
  380.       exit
  381.  
  382.  
  383.  
  384. ;MORE__________________________________________________________________________________________________
  385.  
  386.  
  387.  
  388.     Case "iNVERT cASE":
  389.       {
  390.          CopyClipboardCLM()
  391.     ;bruh := RegExReplace(Clipboard, "\s+$")   ;gets rid of whitespace at end (1)
  392.     ;Clipboard := bruh            ;gets rid of whitespace at end (2)
  393.          Inv_Char_Out := ""
  394.          Loop % StrLen(Clipboard)
  395.          {
  396.              Inv_Char := SubStr(Clipboard, A_Index, 1)
  397.              if Inv_Char is Upper
  398.                  Inv_Char_Out := Inv_Char_Out Chr(Asc(Inv_Char) + 32)
  399.              else if Inv_Char is Lower
  400.                  Inv_Char_Out := Inv_Char_Out Chr(Asc(Inv_Char) - 32)
  401.              else
  402.                  Inv_Char_Out := Inv_Char_Out Inv_Char
  403.          }
  404.          Clipboard := Inv_Char_Out
  405.          PasteClipboardCLM()
  406.       }
  407.  
  408.     Case "SpOnGeBoB cAsE":
  409.       {
  410.           CopyClipboardCLM()
  411.     ;bruh := RegExReplace(Clipboard, "\s+$")   ;gets rid of whitespace at end (1)
  412.     ;Clipboard := bruh                         ;gets rid of whitespace at end (2)
  413.           Inv_Char_Out := ""
  414.           StringLower, Clipboard, Clipboard
  415.           Loop, Parse, Clipboard
  416.           {
  417.               if (Mod(A_Index, 2) = 0)
  418.           Inv_Char_Out .= Format("{1:L}", A_LoopField)
  419.               else
  420.                   Inv_Char_Out .= Format("{1:U}", A_LoopField)                  
  421.           }
  422.           Clipboard := Inv_Char_Out
  423.           PasteClipboardCLM()
  424.       }
  425.  
  426.  
  427.     Case "S p r e a d T e x t":
  428.     {
  429.     vText := "exemple"
  430.     ;TempText := RegExReplace(TempText, "\s+$")   ;gets rid of whitespace at end
  431.     TempText := % RegExReplace(TempText, "(?<=.)(?=.)", " ")
  432.     }  
  433.  
  434.  
  435.     Case "raNDoM cASE":
  436.     {
  437.        CopyClipboardCLM()
  438.     ;bruh := RegExReplace(Clipboard, "\s+$")   ;gets rid of whitespace at end (1)
  439.     ;Clipboard := bruh                         ;gets rid of whitespace at end (2)
  440.        RandomCase := ""
  441.       for _, v in StrSplit(Clipboard)
  442.      {
  443.          Random, r, 0, 1
  444.          RandomCase .= Format("{:" (r?"L":"U") "}", v)
  445.       }
  446.       Clipboard := RandomCase
  447.       PasteClipboardCLM()
  448.     }
  449.  
  450.  
  451.     Case "Reverse":
  452.       ;TempText := RegExReplace(TempText, "\s+$")   ;gets rid of whitespace at end
  453.       Temp2 =
  454.       StringReplace, TempText, TempText, `r`n, % Chr(29), All
  455.       Loop Parse, TempText
  456.         Temp2 := A_LoopField . Temp2
  457.       StringReplace, TempText, Temp2, % Chr(29), `r`n, All
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. Case "Dark Mode | Light Mode":
  467.  
  468.     If (DarkMode)
  469.     {
  470.         DarkMode := false
  471.         ;Menu, Case, Toggle Mode, Dark Mode
  472.         MenuDark(3) ; Set to ForceLight
  473.     WelcomeTrayTipLight()
  474.     }
  475.     else
  476.     {
  477.         DarkMode := true
  478.         ;Menu, Case, Toggle Mode, Light Mode
  479.         MenuDark(2) ; Set to ForceDark
  480.     WelcomeTrayTipDark()
  481.     }
  482. Return
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.   }
  490.  
  491. SetCapsLockState, Off
  492.  
  493.  
  494.  
  495.  
  496.  
  497. ;__________________________________________________________________________________________________
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504. ;;;;;;;;;;;\/ THIS HAS TO BE AT THE BOTTOM OF ALL THE CASE THINGS (Pastes TempText) ;;;;;;;;;;;;;
  505.  
  506. PutText(TempText)
  507. SetCapsLockState, Off
  508. Return
  509.  
  510. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519. ;;;;;;;;;;;;;;;;;;; Handy function. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  520. ; Copies the selected text to a variable while preserving the clipboard.
  521. GetText(ByRef MyText = "")
  522. {
  523.    SavedClip := ClipboardAll
  524.    Clipboard =
  525.    Send ^c
  526.    ClipWait 0.5
  527.    If ERRORLEVEL
  528.    {
  529.       Clipboard := SavedClip
  530.       MyText =
  531.       Return
  532.    }
  533.    MyText := Clipboard
  534.    Clipboard := SavedClip
  535.    Return MyText
  536. }
  537.  
  538. ; Pastes text from a variable while preserving the clipboard.
  539. PutText(MyText)
  540. {
  541.    SavedClip := ClipboardAll
  542.    Clipboard =              ; For better compatability
  543.    Sleep 20                 ; with Clipboard History
  544.    Clipboard := MyText
  545.    Send ^v
  546.    Sleep 100
  547.    Clipboard := SavedClip
  548.    Return
  549. }
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561. CopyClipboard()
  562. {
  563.     global ClipSaved := ""
  564.     ClipSaved := ClipboardAll  ; save original clipboard contents
  565.     Clipboard := ""  ; start off empty to allow ClipWait to detect when the text has arrived
  566.     Send {Ctrl down}c{Ctrl up}
  567.     Sleep 150
  568.     ClipWait, 1.5, 1
  569.     if ErrorLevel
  570.     {
  571.         MsgBox, 262208, AutoHotkey, Copy to clipboard failed.
  572.         Clipboard := ClipSaved  ; restore the original clipboard contents
  573.         ClipSaved := ""  ; clear the variable
  574.         return
  575.     }
  576. }
  577.  
  578.  
  579.  
  580. CopyClipboardCLM()
  581. {
  582.     global ClipSaved
  583.     WinGet, id, ID, A
  584.     WinGetClass, class, ahk_id %id%
  585.     if (class ~= "(Cabinet|Explore)WClass|Progman")
  586.         Send {F2}
  587.     Sleep 100
  588.     CopyClipboard()
  589.     if (ClipSaved != "")
  590.         Clipboard := Clipboard
  591.     else
  592.         Exit
  593. }
  594.  
  595. PasteClipboardCLM()
  596. {
  597.     global ClipSaved
  598.     WinGet, id, ID, A
  599.     WinGetClass, class, ahk_id %id%
  600.     if (class ~= "(Cabinet|Explore)WClass|Progman")
  601.         Send {F2}
  602.     Send ^v
  603.     Sleep 100
  604.     Clipboard := ClipSaved
  605.     ClipSaved := ""
  606.     Exit
  607. }
  608.  
  609.  
  610.  
  611. SetCapsLockState, Off
  612. Send, {capslock up}
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635. ;;;;;;;;;;;;;;;;;;;; Loadung Bar epic script ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  636.  
  637.  
  638. LoadingBar() {
  639.  
  640. sleep 650
  641.  
  642. ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  643. ;!! \/ WHOLE OTHER SCRIPT here \/ !!
  644. ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  645.  
  646.  
  647. ; Declare variables
  648. SetTimer,TOOLTIP,1500
  649. SetTimer,TOOLTIP,Off
  650. TimeCapsToggle = 5
  651. TimeOut = 30
  652. global stringGlobal := ""
  653.  
  654.  
  655. ; Define hotstring, trigger via hold CapsLock for 1.5s or hold Right Click + Middle click
  656.  
  657.  
  658. ;====== RED LOADING BAR ===;
  659.     counter = 0
  660.     Progress, ZH16 ZX0 ZY0 B R0-%TimeOut%
  661.     Loop, %TimeOut%
  662.     {
  663.         Sleep, 20        ;10
  664.         counter += 1
  665.         Progress, %counter%
  666.         If (counter = TimeCapsToggle)
  667.             Progress, ZH16 ZX0 ZY0 B R0-%TimeOut% CBFF0000  ;CB is seperate, hex/html colorcode
  668.        
  669.     }
  670.     Progress, Off
  671.  
  672.  
  673. ;====== ORANGE LOADING BAR ===;
  674.     counter = 0
  675.     Progress, ZH16 ZX0 ZY0 B R0-%TimeOut%
  676.     Loop, %TimeOut%
  677.     {
  678.         Sleep, 20
  679.         counter += 1
  680.         Progress, %counter%
  681.         If (counter = TimeCapsToggle)
  682.             Progress, ZH16 ZX0 ZY0 B R0-%TimeOut% CBff9900  ;CB is seperate, hex/html colorcode
  683.        
  684.     }
  685.     Progress, Off
  686.  
  687.  
  688. ;====== YELLOW LOADING BAR ======;
  689.     counter = 0
  690.     Progress, ZH16 ZX0 ZY0 B R0-%TimeOut%
  691.     Loop, %TimeOut%
  692.     {
  693.         Sleep, 20
  694.         counter += 1
  695.         Progress, %counter%
  696.         If (counter = TimeCapsToggle)
  697.             Progress, ZH16 ZX0 ZY0 B R0-%TimeOut% CBFFD700  ;CB is seperate, hex/html colorcode
  698.        
  699.     }
  700.     Progress, Off
  701.    
  702.  
  703. ;====== GREEN LOADING BAR ======;
  704.     counter = 0
  705.     Progress, ZH16 ZX0 ZY0 B R0-%TimeOut%
  706.     Loop, %TimeOut%
  707.     {
  708.         Sleep, 20
  709.         counter += 1
  710.         Progress, %counter%
  711.         If (counter = TimeCapsToggle)
  712.             Progress, ZH16 ZX0 ZY0 B R0-%TimeOut% CB1DB954  ;CB is seperate, hex/html colorcode
  713.        
  714.     }
  715.     Progress, Off
  716.  
  717.  
  718. ;====== LIGHT BLUE (aka indigo) LOADING BAR ======;
  719.     counter = 0
  720.     Progress, ZH16 ZX0 ZY0 B R0-%TimeOut%
  721.     Loop, %TimeOut%
  722.     {
  723.         Sleep, 20
  724.         counter += 1
  725.         Progress, %counter%
  726.         If (counter = TimeCapsToggle)
  727.             Progress, ZH16 ZX0 ZY0 B R0-%TimeOut% CB3CDFFF  ;CB is seperate, hex/html colorcode
  728.        
  729.     }
  730.     Progress, Off
  731.  
  732.  
  733. ;====== DARK BLUE (aka indigo) LOADING BAR ======;
  734.     counter = 0
  735.     Progress, ZH16 ZX0 ZY0 B R0-%TimeOut%
  736.     Loop, %TimeOut%
  737.     {
  738.         Sleep, 20
  739.         counter += 1
  740.         Progress, %counter%
  741.         If (counter = TimeCapsToggle)
  742.             Progress, ZH16 ZX0 ZY0 B R0-%TimeOut% CB0000FF  ;CB is seperate, hex/html colorcode
  743.        
  744.     }
  745.     Progress, Off
  746.  
  747.  
  748. ;====== PURPLE LOADING BAR ======;
  749.     counter = 0
  750.     Progress, ZH16 ZX0 ZY0 B R0-%TimeOut%
  751.     Loop, %TimeOut%
  752.     {
  753.         Sleep, 20
  754.         counter += 1
  755.         Progress, %counter%
  756.         If (counter = TimeCapsToggle)
  757.             Progress, ZH16 ZX0 ZY0 B R0-%TimeOut% CB7F00FF   ;CBCF9FFF ;CB is seperate, hex/html colorcode
  758.        
  759.     }
  760.     Progress, Off
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771. ; Close ToolTip
  772. TOOLTIP:
  773.     ToolTip,
  774.     SetTimer,TOOLTIP,Off
  775.  
  776.  
  777. ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  778. ;!! /\ WHOLE OTHER SCRIPT here /\ !!
  779. ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  780.  
  781.  
  782.  
  783. sleep 90
  784.  
  785. boom =
  786. (
  787.            
  788.  ░          ░ ░      ░ ░         ░  
  789.  ░    ░ ░ ░ ░ ▒  ░ ░ ░ ▒  ░      ░  
  790. ▒░▒   ░   ░ ▒ ▒░   ░ ▒ ▒░ ░  ░      ░
  791. ░▒ ▒░▒░ ▒░ ▒░▒░▒░ ░ ▒░▓░▒
  792. ⣿⡟⠛⠛⢿⣿⣿⣿⣿⣿⣿⣟⠛⢻⣿⣿⣿⣿⣿⣿⡿⠛⣿⣿⣿⣿⡿⠛⠛⣿░▒
  793. ⣿⣧⣄⠀⠈⠻⣿⣿⣿⣿⣿⣿⡄⠸⣿⣿⣿⣿⣿⣿⢃⣾⣿⣿⣿⡿⠁⠀⠀⣿▒░
  794. ⣿⣿⣿⣿⣶⣄⠙⢿⣿⣿⣿⣿⣿⡄⣿⣿⣿⣿⢹⣿⣿⣿⣿⣿⠟⠀⣀⣴⣾⣿░░  
  795. ⣿⣿⣿⣿⣿⣿⣿⣮⡻⣿⣿⣿⣿⣷⣿⣿⣿⠃⢸⡿⢱⣿⡿⢃⣴⣾⣿⣿⣿⣿░    
  796. ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠙⢿⣿⣿⡿⠋⠀⠘⢠⣿⣿⣶⣿⣿⣿⣿⣿⣿⣿▓ ░
  797. ⣿⣿⣿⣿⣿⣿⣮⣍⡛⠛⠋⠀⠀⠈⠉⠀⠀⠀⠀⢸⣿⡿⢿⣿⣿⣿⠿⠟⠛⣿█▓   ▒
  798. ⣿⣿⣿⣷⣮⣍⡉⠉⠉⠀⠀⠀⢀⣤⣄⣤⣤⣄⠀⠀⠀⣰⣿⣯⣭⣴⣶⣶⣶⣿███  
  799. ⣿⡇⠈⠙⠛⠿⢿⣷⣄⠀⠀⢿ BOOM ⡋⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿▀▒░▒░▒
  800. ⣿⣿⣿⣿⣿⣿⡿⣿⣿⠇⠀⠀⠰⣿⣿⠀⠿⠋⠀⠀⠀⠈⠙⠿⣿⣿⣿⣿⣿⣿░ ▒░▒░▒
  801. ⣿⡟⠉⢉⣡⣴⣿⠟⠁⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⣤⣤⣬⣭⣿⣟⣿░ ░ ▒ ▒
  802. ⣿⣧⣴⣿⣿⣿⣥⣶⣶⣄⠀⠀⠀⠀⠀⢀⣤⣶⣦⣄⡐⢶⣦⣤⣙⡿⣿⣿⣿⣿░   ▒
  803. ⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⠀⢀⣤⡆⢠⣿⣿⣿⣿⣿⣿⣦⣿⣿⣿⣿⣿⣿⣿⣿▒░
  804. ⣿⣿⣿⡿⠟⣡⣾⣿⣿⠇⣠⣿⣿⢣⣿⣿⡇⣿⣿⣿⣿⡝⢿⣿⣿⣿⣿⣿⣿⣿░▒░
  805. ⣿⡟⠋⠀⣴⣿⣿⣿⣏⣴⣿⣿⣿⣿⣿⣿⠇⣿⣿⡌⢿⣿⣧⡈⠛⢿⣿⣿⣿⣿▒░  
  806. ⣿⣧⣤⣾⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣤⣽⣿⣷⣤⣽⣿⣿⣤⣤⣬⣽⣿⣿░
  807. ░▒▓███▀▒░ ▒░▒░▒░ ░ ▒░▒░▒
  808. ▒░▒   ░   ░ ▒ ▒░   ░ ▒ ▒░ ░  ░      ░
  809.  ░    ░ ░ ░ ░ ▒  ░ ░ ░ ▒  ░      ░  
  810.             ░ ░      ░ ░         ░  
  811.       ░    
  812.  
  813. )
  814.  
  815. msgbox %boom%
  816.  
  817. MyTitle := "Thank You"
  818.  
  819. msgbox, 0, %MyTitle% (1/5), Thank you for using this script. I spent a lot of time making it.
  820.  
  821. msgbox, 0, %MyTitle% (2/5), My goal was to make THE capslock menu. `n`nAnything that is not used on a daily basis is placed in the 'More Options' section.
  822.  
  823. msgbox, 0, %MyTitle% (3/5), This script was HEAVILY inspired/reused code from u/S3rLoG and his capslock menu, so huge credit to him! `n`n(That loading bar also used to be in his script but he removed it in a later release)
  824.  
  825. msgbox, 0, %MyTitle% (4/5), Thank you everyone, especially the ahk reddit community, for all of your help. `n`n(I could NOT have made this without help) `n`n(Special shoutout to u/anonymous1184 for being a legend whose comments always offer the solutions I need) `n`nAlso, feel free to copy code from this script, or change it in any way you want!
  826.  
  827. msgbox, 0, %MyTitle% (5/5), IMPORTANT NOTES: `n`n• Pressing A opens More Options  `n`n• To set dark mode as the default, follow the instructions under ===Settings=== in the script `n`n• Ctrl-SHIFT-Capslock will send {Ctrl A} to select ALL text before showing the menu. Try it out!
  828.  
  829. SetCapsLockState, Off
  830.  
  831.     Exit
  832.  
  833.  
  834.  
  835. }
  836.  
  837. return
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859. ;;;;;;;;;;;;;;;;;;;; Dark Mode Activated GUI Script ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  860.  
  861.  
  862.  
  863.  
  864. WelcomeTrayTipDark() {
  865.     static GuiCreated := 0
  866.     static HwndWelcomeScreen1
  867.     static MonRight, MonBottom
  868.     if !GuiCreated  {
  869.         GuiCreated := 1
  870.         Gui, WelcomeScreen1:New, +AlwaysOnTop -Caption +ToolWindow +HwndHwndWelcomeScreen1 +LastFound -DPIScale +E0x20 ; Clickthrough=E0x20
  871.         Gui, WelcomeScreen1:Margin, 30, 25
  872.         Gui, WelcomeScreen1:Font, s30, Segoe UI
  873.         Gui, WelcomeScreen1:Color, 1A1A1A
  874.         Gui, WelcomeScreen1:Add, Text, y20 cWhite, Dark Mode Activated   ;, %A_UserName% ; make a text control showing welcome back, (username)
  875.         WinSet, Transparent, 0                              ; set gui transparent
  876.         SysGet, P, MonitorPrimary                           ; get primary monitor number
  877.         SysGet, Mon, MonitorWorkArea, % P                   ; get size of primary monitor
  878.         Gui, WelcomeScreen1:Show, Hide                       ; Show gui
  879.         WinGetPos, X, Y, W, H                               ; get pos of gui
  880.         WinMove, % MonRight - W - 10, % MonBottom - H - 10  ; move gui to bottom right
  881.         WinSet, Region, 0-0 W%W% H%H% R20-20                ; round corners
  882.     }
  883.     Gui, WelcomeScreen1:Show, NA
  884.     bf := Func("AnimateFadeIn").Bind(HwndWelcomeScreen1)
  885.     SetTimer, %bf%, -200
  886. }
  887.  
  888.  
  889. WelcomeTrayTipLight() {
  890.     static GuiCreated := 0
  891.     static HwndWelcomeScreen
  892.     static MonRight, MonBottom
  893.     if !GuiCreated  {
  894.         GuiCreated := 1
  895.         Gui, WelcomeScreen:New, +AlwaysOnTop -Caption +ToolWindow +HwndHwndWelcomeScreen +LastFound -DPIScale +E0x20 ; Clickthrough=E0x20
  896.         Gui, WelcomeScreen:Margin, 30, 25
  897.         Gui, WelcomeScreen:Font, s30, Segoe UI
  898.         Gui, WelcomeScreen:Color, white  ;<=--\/---------------COLOR OF BOX / TEXT
  899.         Gui, WelcomeScreen:Add, Text, y20 cBlack, Light Mode Activated   ;, %A_UserName% ; make a text control showing welcome back, (username)
  900.         WinSet, Transparent, 0                              ; set gui transparent
  901.         SysGet, P, MonitorPrimary                           ; get primary monitor number
  902.         SysGet, Mon, MonitorWorkArea, % P                   ; get size of primary monitor
  903.         Gui, WelcomeScreen:Show, Hide                       ; Show gui
  904.         WinGetPos, X, Y, W, H                               ; get pos of gui
  905.         WinMove, % MonRight - W - 10, % MonBottom - H - 10  ; move gui to bottom right
  906.         WinSet, Region, 0-0 W%W% H%H% R20-20                ; round corners
  907.     }
  908.     Gui, WelcomeScreen:Show, NA
  909.     bf := Func("AnimateFadeIn").Bind(HwndWelcomeScreen)
  910.     SetTimer, %bf%, -200
  911. }
  912.  
  913.  
  914.  
  915. AnimateFadeIn(hwnd) {
  916.     static Value := 0
  917.     WinSet, Transparent, % Value+=15, % "ahk_id" hwnd
  918.     if (Value >= 255) {                         ; if gui is fully opaque
  919.         Value := 0                              ; reset transparency value
  920.         bf := Func("AnimateFadeOut").Bind(hwnd) ; make bound function to fade out
  921.         SetTimer, %bf%, -1000     ;<=--------------------------------------------------------CHANGE HOW LONG
  922.     } else {
  923.         bf := Func("AnimateFadeIn").Bind(hwnd)  ; create bound functiion to fade in
  924.         SetTimer, %bf%, -15                     ; rerun bound function until gui is fully opaque
  925.     }
  926. }
  927.  
  928. AnimateFadeOut(hwnd) {
  929.     static Value := 255
  930.     WinSet, Transparent, % Value-=15, % "ahk_id" hwnd
  931.     if (Value <= 0) {                           ; if gui invisible
  932.         Value := 255                            ; reset transparency value
  933.         Gui, %hwnd%:Hide                        ; hide gui when finished
  934.     } else {
  935.         bf := Func("AnimateFadeOut").Bind(hwnd) ; create bound functiion to fade out
  936.         SetTimer, %bf%, -15                     ; rerun bound function until gui is transparent
  937.     }
  938. }
  939.  
  940.  
  941.  
  942.  
  943.  
Tags: ahk autohotkey
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement