;CAPshift.ahk
;Slows down and extends the CapsLock key.
; Also slows down F1, Insert, NumLock and ScrollLock
;
;Hold for 0.5 sec to toggle caps lock on or off.
;Hold for 1 sec to show a menu that converts selected text to
; UPPER CASE, lower case, Title Case or iNVERT cASE.
;
;If the keyboard is idle for 120 seconds, CapsLock is turned off.
;
;Skrommel @2005
applicationname=CAPshift
{
Input,key
,L1 T1 V
,{LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause} If (ErrorLevel<>"Timeout")
If (A_TickCount-time>=capslockidle*1000)
{
If capslockidle>0
}
}
Return
ACTIVEWIN:
If id=
id=%oldid%
If class=Shell_TrayWnd
id=%oldid%
If id=AutoHotkey
id=%oldid%
oldid=%id%
Return
DELAY:
Else
Return
THEREST:
counter=500
{
If showstatus=1
counter-=100
If state=U
}
If showstatus=1
If counter=0
Else
{
If state=U
{
If showstatus=1
}
Else
{
If showstatus=1
}
}
Return
CAPSLOCK:
counter=1000
{
If showstatus=1
counter-=100
If counter=500
If state=U
}
If showstatus=1
If counter=0
Else
If counter<600
{
If state=D
Else
}
Return
status=
key=Insert
key=CapsLock
key=NumLock
key=ScrollLock
If showstatus=1
Return
GETSTATE:
If state=D
status=%status%%key%`n
Return
Menu,convert
,Add,&iNVERT cASE
,INVERT
Menu,convert
,Add,Replace user
&chars
,REPLACE
Menu,convert
,Add,&Settings
...,SETTINGS
Return
TRAYMENU:
Menu,Tray
,Add,Replace user
&chars
,REPLACE
Menu,Tray
,Add,&Settings
...,SETTINGS
Menu,Tray
,Tip
,%applicationname% Return
TOOLTIPON:
Return
TOOLTIPOFF:
If showstatus=1
Return
ON:
If showstatus=1
Return
OFF:
If showstatus=1
Return
TOGGLE:
If state=D
{
If showstatus=1
}
Else
{
If showstatus=1
}
Return
CUT:
MsgBox clp just saved to oldClp which is
%oldClipboard% ;####################################debug
If class In Progman,WorkerW,Explorer,CabinetWClass
string=%clipboard%
msgbox bottom of CUT sub`nstr is
%string% ;####################################debug
Return
PASTE:
MsgBox now at paste sub
and str is
%string% ;####################################debug
If class In Progman,WorkerW,Explorer,CabinetWClass
MsgBox just before
send`nclipbrd is
%Clipboard%`noldClipbrd
%oldclipboard% ;####################################debug
oldclipboard=
Return
UPPER:
MsgBox top of upper sub
;####################################debug
If showstatus=1
ToolTip,Selection converted to UPPER CASE
Return
LOWER:
If showstatus=1
ToolTip,Selection converted to lower case
Return
TITLE:
If showstatus=1
ToolTip,Selection converted to Title Case
Return
INVERT:
{
If char Is Upper
Else
If char Is Lower
string=%string%%char%
}
If showstatus=1
ToolTip,Selection converted to iNVERTED cASE
Return
{
Else
string=%string%%char%
}
If showstatus=1
Return
REPLACE:
{
from:=swap_%A_Index%_1
to:=swap_%A_Index%_2
}
If showstatus=1
ToolTip,Selection's User chars replaced
Return
ABOUT:
Gui,99:
Add,Text,y
+10,CAPshift slows
down and extends the
CapsLock key
. Gui,99:
Add,Text,y
+5,It also slows
down F1, Insert, NumLock and ScrollLock. Gui,99:
Add,Text,y
+10,- Hold
down CapsLock for
.5 sec to toggle
CapsLock on
or off
. Gui,99:
Add,Text,y
+5,UPPER CASE
, lower case
, Title Case
, iNVERT cASE
, RaNDoM CaSE
Gui,99:
Add,Text,y
+5,or to Replace user defined chars as defined in CAPshift
.ini
. Gui,99:
Add,Text,y
+10,- If the keyboard is idle for
120 seconds
, CapsLock is turned off
.
Gui,99:
Add,Text,x
+10 yp
+10,1 Hour Software by Skrommel
Gui,99:
Add,Text,y
+10,For more tools
, information
and donations
, please visit
Gui,99:
Add,Text,y
+5 G1HOURSOFTWARE
,www
.1HourSoftware
.com
Gui,99:
Add,Text,y
+10,Please support the contributors at
Gui,99:
Add,Text,y
+5 GDONATIONCODER
,www
.DonationCoder
.com
Gui,99:
Add,Text,y
+10,This tool was made using the powerful
Gui,99:
Add,Text,y
+5 GAUTOHOTKEY
,www
.AutoHotkey
.com
Gui,99:
Show,,%applicationname% About
hCurs
:=DllCall("LoadCursor","UInt",NULL
,"Int",32649,"UInt") ;IDC_HANDReturn
1HOURSOFTWARE:
Run,http:
//www
.1hoursoftware
.com
,,UseErrorLevel
Return
DONATIONCODER:
Run,http:
//www
.donationcoder
.com
,,UseErrorLevel
Return
AUTOHOTKEY:
Run,http:
//www
.autohotkey
.com
,,UseErrorLevel
Return
99GuiClose:
DllCall("DestroyCursor","Uint",hCur
) Return
WM_MOUSEMOVE(wParam,lParam)
{
Global hCurs
If ctrl in Static13,Static17,Static21
Return
}
Return
SETTINGS:
Return
READINI:
{
inifile=;CAPshift.ini
inifile=%inifile%`n`;[Settings]
inifile=%inifile%`n`;capslockidle=120 `;0-999 0=Off Seconds to wait before turning off CapsLock when the keyboard is idle
inifile=%inifile%`n`;showstatus=1 `;0,1 0=Hide 1=Show Hide or show the status windows
inifile=%inifile%`n`;delaycapslock=1 `;0,1 0=Ignore CapsLock 1=Delay F1
inifile=%inifile%`n`;delayf1=1 `;0,1 0=Ignore F1 1=Delay F1
inifile=%inifile%`n`;delayinsert=1
inifile=%inifile%`n`;delayscrolllock=1
inifile=%inifile%`n`;delaynumlock=1
inifile=%inifile%`n`;
inifile=%inifile%`n`;ae=æ `;Chars to replace=Chars to replace with
inifile=%inifile%`n`;oe=ø `;Special characters:
inifile=%inifile%`n`;aa=å `; .space. .tab. .return. .newline. .comma. .semicolon.
inifile=%inifile%`n`;AE=Æ
inifile=%inifile%`n`;OE=Ø
inifile=%inifile%`n`;AA=Å
inifile=%inifile%`n`;AA=Å
inifile=%inifile%`n`;.return..newline..return..newline.= ;Removes empty lines
inifile=%inifile%`n
inifile=%inifile%`n[Settings]
inifile=%inifile%`ncapslockidle=120
inifile=%inifile%`nshowstatus=1
inifile=%inifile%`ndelaycapslock=1
inifile=%inifile%`ndelayf1=1
inifile=%inifile%`ndelayinsert=1
inifile=%inifile%`ndelayscrolllock=1
inifile=%inifile%`ndelaynumlock=1
inifile=%inifile%`n
inifile=%inifile%`nae=æ
inifile=%inifile%`noe=ø
inifile=%inifile%`naa=å
inifile=%inifile%`nAE=Æ
inifile=%inifile%`nOE=Ø
inifile=%inifile%`nAA=Å
inifile=
}
IniRead,capslockidle
,CAPshift
.ini
,Settings
,capslockidle
IniRead,showstatus
,CAPshift
.ini
,Settings
,showstatus
IniRead,delaycapslock
,CAPshift
.ini
,Settings
,delaycapslock
IniRead,delayf1
,CAPshift
.ini
,Settings
,delayf1
IniRead,delayinsert
,CAPshift
.ini
,Settings
,delayinsert
IniRead,delayscrolllock
,CAPshift
.ini
,Settings
,delayscrolllock
IniRead,delaynumlock
,CAPshift
.ini
,Settings
,delaynumlock
If delaycapslock=1
If delayf1=1
If delayinsert=1
If delaynumlock=1
If delayscrolllock=1
swapcount=0
{
If char=`;
If A_LoopReadLine Contains capslockidle
=,showstatus
=,delaycapslock
=,delayf1
=,delayinsert
=,delayscrolllock
=,delaynumlock
= swapcount+=1
}
Return