Home » Questions » Computers [ Ask a new question ]

What is the Windows keyboard shortcut for changing case in selected text?

What is the Windows keyboard shortcut for changing case in selected text?

for when we use F2 to rename filenames and after that I want to change the case of those filenames

Asked by: Guest | Views: 372
Total answers/comments: 2
Guest [Entry]

"Well, here's a quick AutoHotkey script I threw together which is tailored to your specific situation (tested and working):

!r::
save := ClipboardAll
Send ^c
clipwait
oldclip := Clipboard
StringLower, newclip, oldclip
If (newclip == oldclip)
{
StringUpper, newclip, oldclip
}
Clipboard := newclip
Send ^v{Enter}
Clipboard := save
return

After pressing F2 to rename, using Alt + r will change the folder's case. If you want to swap case of each letter separately, well, that's something different entirely. I know most people on here aren't very appreciative of animated GIFs embedded directly on the page, so if you'd like to see it in action, click here."
Guest [Entry]

"My solution to this in AHK

#SingleInstance Force

k := 1
<Shift::
save := ClipboardAll
Clipboard =
Send ^c
oldclip := Clipboard

if(newclip == oldclip){
}
else{
k := 1
}

if(StrLen(oldclip) = 0){
msgbox, jai ganesh!
return
}
else if (k = 1){ ;to inverse case

newclip:= """"
Loop % Strlen(oldclip) {
Lab_Invert_Char:= Substr(oldclip, A_Index, 1)
if Lab_Invert_Char is upper
newclip:= newclip Chr(Asc(Lab_Invert_Char) + 32)
else if Lab_Invert_Char is lower
newclip:= newclip Chr(Asc(Lab_Invert_Char) - 32)
else
newclip:= newclip Lab_Invert_Char
}
else if(k = 2){ ;to lower case
StringLower, newclip, oldclip

}
else if(k = 3){ ;to upper case
StringUpper, newclip, oldclip
}
else if(k = 4){ ;to sentence case
StringUpper newclip, oldclip, T
}
}
k++
if (k = 5){
k := 1
}
Clipboard := newclip
Send ^v
x:=StrLen(Clipboard)
Send {shift down}{Left %x%}{shift up}
Clipboard := save
return"