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 

double capslock to close a window

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



Joined: 26 Sep 2007
Posts: 44

PostPosted: Tue Jun 03, 2008 11:39 am    Post subject: double capslock to close a window Reply with quote

Code:

capslock::
keywait capslock
keywait capslock,d t0.5
if errorlevel

 return
MouseClick, left,  1019,  37
return


responds to double capslock, but renders the key's original function inactive.

I have tried this


Code:

capslock::
keywait capslock
keywait capslock,d t0.5
if errorlevel
SEND {CapsLock}
 return
MouseClick, left,  1019,  37
return


which is intended to make
single CL do capslock
and
double CL close the window

but CL lights up and stays so - doesn't toggle.


Can you help me out?

[I have WinXP]
Back to top
View user's profile Send private message
HugoV



Joined: 27 May 2007
Posts: 499

PostPosted: Tue Jun 03, 2008 12:05 pm    Post subject: Reply with quote

Have a look at A double click hotkey
http://www.autohotkey.com/forum/topic12761.html
(Philho, replace CTRL with Capslock)
To toggle capslock simply use Send {BLIND}{capslock}

Post your modified script if you can't get it to work.
Back to top
View user's profile Send private message
TOTAL



Joined: 26 Sep 2007
Posts: 44

PostPosted: Tue Jun 03, 2008 9:04 pm    Post subject: Reply with quote

Had to do something to prevent the change of the state of caps.

Thanks!

Code:

CapsLock::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500)
   {
      MouseClick, left,  1019,  37
          Send {BLIND}{capslock}
    }
   else Send {BLIND}{capslock}
   
Return
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