AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

cHANGE cASE pOSSIBLE?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
b.IT
Guest





PostPosted: Thu Jun 05, 2008 4:46 pm    Post subject: cHANGE cASE pOSSIBLE? Reply with quote

Hi,

everbody knows this: you have accidently hit CapsLock, type away and end with as string like "cAPSlOCK"

what I would like to achieve is:

write a systemwide macro that gets the selected text from the active window (TextBox, RichText etc) and on STRG+CapsLock switch the casing of the selection.

Can this be done with autohotkey?

regards
b.IT
Back to top
Razlin



Joined: 05 Nov 2007
Posts: 340
Location: canada

PostPosted: Thu Jun 05, 2008 4:55 pm    Post subject: Reply with quote

Im sure it can be done
maybe something you can add to your day to day scripts is

Code:
~Capslock::
GetKeystate, capsState, Capslock, T
Progress, b fs18 zh0, % ((capsState = "D") ? ("CAPSLOCK ON") : ("Capslock Off")), , , Courier New
SoundBeep, 1000, 25
SoundPlay, *-1
sleep 500
Progress, Off
return


will popup everytimd you hit the capslock key with a beep.

one beep is system speakers the other is headphones.

in case your headphones are off Smile
_________________
-=Raz=-
Back to top
View user's profile Send private message
SoggyDog



Joined: 02 May 2006
Posts: 214
Location: Greeley, CO

PostPosted: Thu Jun 05, 2008 5:21 pm    Post subject: Reply with quote

I've been using this script for a long time;
It helps manage accidental caps locking and provides additional functions for changing case.
_________________

SoggyDog
Download AutoHotKey Wallpaper
Does 'Fuzzy Logic' tickle?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
[VxE]



Joined: 07 Oct 2006
Posts: 1071

PostPosted: Fri Jun 06, 2008 3:03 am    Post subject: Reply with quote

Code:
InvertStringCaps( string = "" )
{
   Loop, parse, string
   {
      ac := Asc(A_LoopField)
      newstring .= Chr(ac+(ac>64&&ac<91 ? 32 : (ac>96&&ac<123 ? -32 : 0)))
   }
   return newstring
}

msgbox % InvertStringCaps("~!@#$`%^&*()_+ A StUpId StRiNg ,./;[]\<>?:{}|1234567890-=")

_________________
My Home Thread
More Common Answers: 1. It's in the FAQ 2. Ternary ( ? : ) guide 3. Post code with [code][/code] tags
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group