AutoHotkey Community

It is currently May 27th, 2012, 12:48 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Caps lock protector
PostPosted: October 5th, 2005, 3:12 am 
Offline

Joined: October 5th, 2005, 3:09 am
Posts: 1
Here's my first little script; every now and then I manage to bump the capslock key, and I find that annoying. But I still want to be able to use it when I *want* to. So, this script doesn't allow plain-old capslock to enter capslock mode, but shift-capslock, alt-capslock, etc, do work. Then plain old capslock gets you back out. It does require the keyboard hook.

Code:
; Only allow capslock if it's shift-capslock
$SC03a::
   GetKeyState,caps,CapsLock,T

   if caps = D
      SetCapsLockState,Off
   return


Cheers
-b


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 5th, 2005, 3:22 am 
try CAPshift by Skrommel...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2005, 9:19 pm 
Hello,

aikens example motivated me to make my first tiny script :-)

Code:
; CapsLock remapped to Shift, but Shift-,Ctrl-,Win-,Alt- Capslock work as usual
CapsLock::Shift
~+CapsLock::
~^CapsLock::
~#CapsLock::
~!CapsLock:: Return


Question about remapping, the Docu says:
"The syntax for the built-in remapping feature is OriginKey::DestinationKey"
Is it OK to Remap to "nothing"?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2005, 1:42 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Quote:
Is it OK to Remap to "nothing"?
The syntax doesn't support it. You've seen that to disable a key, just put a return after it. For example, the following disables RWin and LWin:

RWin::Return
LWin::Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2005, 2:43 pm 
Offline

Joined: February 7th, 2005, 11:11 am
Posts: 192
Location: Munich, Germany
The best caps lock protector of them all:
Image
:D :D :D

Peter


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 18th, 2008, 9:41 am 
Offline

Joined: August 18th, 2008, 9:18 am
Posts: 6
Location: Queensland, Australia
Without understanding the script I copied Aitkens script to imobilise the capslock key (unless the command is shift-capslock or alt-capslock).
I knew it .......... even testing it I mangaed to hit the two adjacent keys accidentally.
So I need to allow alt-capslock only or Win-capslock which is the key combo I prefer right now whilst just getting started.
Could someone help please with the correct script in each case & perhaps explain how the script command string is arrived at.
TIA
Peter O

PS I have previously in desperation, applied surgery to my keyboard (just as the pic posted in this thread shows), but it' a tad inellegant as solutions go right?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2008, 11:02 am 
Offline

Joined: October 5th, 2007, 2:21 am
Posts: 138
Location: Bundaberg (Bundy), Qld, Australia
this code by lexikos lets you change capslock by holding it down for 0.5secs which avoids accidental hits
Code:
CapsLock::
    Keywait, CapsLock, T0.5
    if ErrorLevel
        SetCapsLockstate,% GetKeyState("CapsLock","T") ? "Off":"On"
    KeyWait, CapsLock
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Capslock protection
PostPosted: August 22nd, 2008, 7:40 am 
Offline

Joined: August 18th, 2008, 9:18 am
Posts: 6
Location: Queensland, Australia
Rodfell,
Thanks for the link.
Actually I had spotted this script but would prefer the Win-Capslock "solution" particularly if I could follow the logic.
If I try the "timed action solution" in your link what do I do with the current Hotkey script, how do you undo these things.
Yes I toiled over the tutorial but I'm afraid it was mostly over my head & I am inclined to think now this Autohotkey program (though superb in flexibility & option rich) is too techy for me.
Rgds & thanks again,
Pete


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Capslock protection
PostPosted: August 22nd, 2008, 12:25 pm 
Offline

Joined: October 5th, 2007, 2:21 am
Posts: 138
Location: Bundaberg (Bundy), Qld, Australia
peterlo wrote:
what do I do with the current Hotkey script, how do you undo these things.
not sure what you mean by this. you apply and undo capslock by holding the capslock key for 0.5 secs. in any event, here is a script you might like. it gets rid of accidental capslock by needing win-capslock. i've kept the code basic.
Code:
capslock::return

#capslock::
getkeystate, capslockstate, capslock, t
if capslockstate=u
   setcapslockstate on
else
   setcapslockstate off
return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Bon, bowen666, Yahoo [Bot] and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group