for when we use f2 to rename file name. after f2 i want to change case of file names
Well, here's a quick AutoHotkey script I threw together which is tailored to your specific situation (tested and working):
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.
There is indeed an AutoHotkey script for this as suggested by outsideblasts in the comments.
Check out toggle/cycle through capitalize-lowercase-uppercase in the AutoHotkey forums. The final version of the script is at the bottom of the page. Select all the code, put it in a .ahk script and run it (it implies you have AutoHotkey installed of course).
I tested it and it works fine in the Explorer and most editors. When the filename is selected, use CTRL+SHIFT+u to toggle the case of the text.