Advertisement
Guest User

Capslock override (toCaps, toLower, Capitalized)

a guest
Jun 29th, 2015
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CapsLock::
  2.     SetCapsLockState, Off
  3.     oldClipboard := Clipboard
  4.     Send, {ctrl down}c{ctrl up}
  5.     if (StrLen(Clipboard) = 0) {
  6.         Clipboard := oldClipboard
  7.         exit
  8.     }
  9.     StringUpper, uppered, Clipboard
  10.     StringLower, lowered, Clipboard
  11.     if (lowered == Clipboard)
  12.         Clipboard := uppered
  13.     else if (uppered == Clipboard)
  14.         Clipboard := RegExReplace(lowered, "((?:^|[.!?]\s+)[a-z])", "$u1")
  15.     else
  16.         Clipboard := lowered
  17.     Send, {ctrl down}v{ctrl up}
  18.     selectionLength := StrLen(Clipboard)
  19.     Send, {shift down}{Left %selectionLength%}{shift up}
  20.     Clipboard := oldClipboard
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement