DonationCoder.com Software > Post New Requests Here
Skommel's CapShift not working in Chrome
(1/1)
kunkel321:
This is Skommel's excellent CapShift "one hour software."
https://www.dcmembers.com/skrommel/download/capshift/
He has the ahk file in his download, but below is a version with a bunch of MsgBox debug stops that I put. I'm trying to figure out why it doesn't work in Chrome browser edit fields. Works fine in Notepad. I'm trying to use the conver-to-UPPER CASE feature from the popup. In Chrome the text doesn't get converted.... CapShift merely pastes whatever is on the clipboard. It seems there's a hickup at line 274 (Send, ^C). The hickup is not consistent though... Sometimes the selected text does get copied to the clipboard, but the app still fails.
Thoughts? I just poseted this at the AutoHotkey forum too.
--- Code: Autohotkey ---;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 #NoEnv#SingleInstance,ForceAutoTrim,Off StringCaseSense,OnSetBatchLines,-1SetWinDelay,0 applicationname=CAPshift Gosub,READINIGosub,TRAYMENU WinGet,oldid,ID,A SetTimer,ACTIVEWIN,500 time:=A_TickCountLoop{ 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") time:=A_TickCount If (A_TickCount-time>=capslockidle*1000) { If capslockidle>0 If (GetKeyState("CapsLock","T")) SetCapsLockState,Off time:=A_TickCount }}Return ACTIVEWIN:WinGet,id,ID,AWinGetClass,class,ahk_id %id%If id= id=%oldid%If class=Shell_TrayWnd id=%oldid%If id=AutoHotkey id=%oldid%oldid=%id%Return DELAY:Gosub,TRAYTIPhotkey=%A_ThisHotkey%IfInString,hotkey,$ StringTrimLeft,hotkey,hotkey,1If hotkey=CapsLock Gosub,CAPSLOCKElse Gosub,THERESTReturn THEREST:counter=500Loop,5{ If showstatus=1 ToolTip,%hotkey% in %counter% ms Sleep,100 counter-=100 GetKeyState,state,%hotkey%,P If state=U Break}If showstatus=1 ToolTip,If counter=0If hotkey=F1 Send,{%hotkey%}Else{ GetKeyState,state,%hotkey%,T If state=U { If hotkey=NumLock SetNumLockState,On If hotkey=ScrollLock SetScrollLockState,On If hotkey=Insert Send,{%hotkey%} If showstatus=1 ToolTip,%hotkey% On } Else { If hotkey=NumLock SetNumLockState,Off If hotkey=ScrollLock SetScrollLockState,Off If hotkey=Insert Send,{%hotkey%} If showstatus=1 ToolTip,%hotkey% Off } SetTimer,TOOLTIPOFF,On}KeyWait,%hotkey%Return CAPSLOCK:counter=1000Loop,10{ If showstatus=1 ToolTip,%hotkey% in %counter% ms Sleep,100 counter-=100 If counter=500 SoundPlay,%SYSTEMROOT%\Media\ding.wav GetKeyState,state,%hotkey%,P If state=U Break}If showstatus=1 ToolTip,If counter=0 Gosub,MENUElseIf counter<600{ GetKeyState,state,%hotkey%,T If state=D Gosub,OFF Else Gosub,ON}Return TRAYTIP:status=key=InsertGosub,GETSTATEkey=CapsLockGosub,GETSTATEkey=NumLockGosub,GETSTATEkey=ScrollLockGosub,GETSTATEIf showstatus=1 TrayTip,Status,%status%,10Return GETSTATE:GetKeyState,state,%key%,TIf state=D status=%status%%key%`nReturn MENU:Menu,convert,AddMenu,convert,DeleteMenu,convert,Add,CAPshift,TOGGLEMenu,convert,Add,Menu,Convert,Add,CapsLock &On,OnMenu,Convert,Add,&CapsLock Off,OffMenu,convert,Add,Menu,convert,Add,&UPPER CASE,UPPERMenu,convert,Add,&lower case,LOWERMenu,convert,Add,&Title Case,TITLEMenu,convert,Add,&iNVERT cASE,INVERTMenu,convert,Add,&RaNDoM CaSE,RANDOMMenu,convert,Add,Replace user &chars,REPLACEMenu,convert,Add,Menu,convert,Add,&Settings...,SETTINGSMenu,convert,Add,&About...,ABOUTMenu,convert,Add,E&xit,EXITMenu,convert,Default,CapShiftMenu,convert,ShowReturn TRAYMENU:Menu,Tray,NoStandard Menu,Tray,DeleteAll Menu,Tray,Add,CAPshift,TOGGLEMenu,Tray,Add,Menu,Tray,Add,CapsLock &On,OnMenu,Tray,Add,&CapsLock Off,OffMenu,Tray,Add,Menu,Tray,Add,&UPPER CASE,UPPERMenu,Tray,Add,&lower case,LOWERMenu,Tray,Add,&Title Case,TITLEMenu,Tray,Add,&iNVERT cASE,INVERTMenu,Tray,Add,&RaNDoM CaSE,RANDOMMenu,Tray,Add,Replace user &chars,REPLACEMenu,Tray,Add,Menu,Tray,Add,&Settings...,SETTINGSMenu,Tray,Add,&About...,ABOUTMenu,Tray,Add,E&xit,EXITMenu,Tray,Default,CapShiftMenu,Tray,Tip,%applicationname%Return TOOLTIPON:Return TOOLTIPOFF:If showstatus=1 ToolTip,SetTimer,TOOLTIPOFF,OffGosub,TRAYTIPReturn ON:SetCapsLockState,OnIf showstatus=1 ToolTip,CapsLock OnSetTimer,TOOLTIPOFF,OnReturn OFF:SetCapsLockState,OffIf showstatus=1 ToolTip,CapsLock OffSetTimer,TOOLTIPOFF,OnReturn TOGGLE:GetKeyState,state,CapsLock,TIf state=D{ SetCapsLockState,Off If showstatus=1 ToolTip,CapsLock Off}Else{ SetCapsLockState,On If showstatus=1 ToolTip,CapsLock On}SetTimer,TOOLTIPOFF,OnReturn CUT:oldclipboard:=ClipboardAll MsgBox clp just saved to oldClp which is %oldClipboard% ;####################################debug WinActivate,ahk_id %id%WinWaitActive,ahk_id %id%,,1WinGetClass,class,ahk_id %id%If class In Progman,WorkerW,Explorer,CabinetWClass Send,{F2}Sleep,500Send,^cClipWait,1string=%clipboard% msgbox bottom of CUT sub`nstr is %string% ;####################################debug Return PASTE:WinActivate,ahk_id %id%WinWaitActive,ahk_id %id%,,1 MsgBox now at paste sub and str is %string% ;####################################debug If class In Progman,WorkerW,Explorer,CabinetWClass Send,{F2}clipboard=%string% MsgBox just before send`nclipbrd is %Clipboard%`noldClipbrd %oldclipboard% ;####################################debug Send,^vClipboard:=oldclipboardoldclipboard=Return UPPER: MsgBox top of upper sub ;####################################debug Gosub,CUT MsgBox before stringUpper str is %string% ;####################################debug StringUpper,string,string MsgBox after stringUpper str is %string% ;####################################debug Gosub,PASTEIf showstatus=1 ToolTip,Selection converted to UPPER CASESetTimer,TOOLTIPOFF,OnReturn LOWER:Gosub,CUTStringLower,string,stringGosub,PASTEIf showstatus=1 ToolTip,Selection converted to lower caseSetTimer,TOOLTIPOFF,OnReturn TITLE:Gosub,CUTStringLower,string,string,TGosub,PASTEIf showstatus=1 ToolTip,Selection converted to Title CaseSetTimer,TOOLTIPOFF,OnReturn INVERT:Gosub,CUTStringLen,length,stringLoop,%length%{ StringLeft,char,string,1 If char Is Upper StringLower,char,char Else If char Is Lower StringUpper,char,char StringTrimLeft,string,string,1 string=%string%%char%}If showstatus=1 ToolTip,Selection converted to iNVERTED cASESetTimer,TOOLTIPOFF,OnGosub,PASTEReturn RANDOM:Gosub,CUTStringLen,length,stringLoop,%length%{ StringLeft,char,string,1 Random,random,1,2 If random=1 StringLower,char,char Else StringUpper,char,char StringTrimLeft,string,string,1 string=%string%%char%}If showstatus=1 ToolTip,Selection converted to RaNDoM CaSESetTimer,TOOLTIPOFF,OnGosub,PASTEReturn REPLACE:AutoTrim,Off StringCaseSense,OnGosub,CUTLoop,%swapcount%{ from:=swap_%A_Index%_1 to:=swap_%A_Index%_2 StringReplace,string,string,%A_Space%,.space.,All StringReplace,string,string,%A_Tab%,.tab.,All StringReplace,string,string,`r,.return.,All StringReplace,string,string,`n,.newline.,All StringReplace,string,string,`,,.comma.,All StringReplace,string,string,`;,.semicolon.,All StringReplace,string,string,%from%,%to%,All StringReplace,string,string,.space.,%A_Space%,All StringReplace,string,string,.tab.,%A_Tab%,All StringReplace,string,string,.return.,`r,All StringReplace,string,string,.newline.,`n,All StringReplace,string,string,.comma.,`,,All StringReplace,string,string,.semicolon.,`;,All}If showstatus=1 ToolTip,Selection's User chars replacedSetTimer,TOOLTIPOFF,OnGosub,PASTEReturn ABOUT:Gui,99:DestroyGui,99:Margin,20,20Gui,99:Add,Picture,xm Icon1,%applicationname%.exeGui,99:Font,BoldGui,99:Add,Text,x+10 yp+10,%applicationname% v1.7Gui,99:FontGui,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+10,- Hold for 1 sec to show a menu that converts selected text to 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,Picture,xm y+20 Icon5,%applicationname%.exeGui,99:Font,BoldGui,99:Add,Text,x+10 yp+10,1 Hour Software by SkrommelGui,99:FontGui,99:Add,Text,y+10,For more tools, information and donations, please visit Gui,99:Font,CBlue UnderlineGui,99:Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.comGui,99:Font Gui,99:Add,Picture,xm y+20 Icon7,%applicationname%.exeGui,99:Font,BoldGui,99:Add,Text,x+10 yp+10,DonationCoderGui,99:FontGui,99:Add,Text,y+10,Please support the contributors atGui,99:Font,CBlue UnderlineGui,99:Add,Text,y+5 GDONATIONCODER,www.DonationCoder.comGui,99:Font Gui,99:Add,Picture,xm y+20 Icon6,%applicationname%.exeGui,99:Font,BoldGui,99:Add,Text,x+10 yp+10,AutoHotkeyGui,99:FontGui,99:Add,Text,y+10,This tool was made using the powerfulGui,99:Font,CBlue UnderlineGui,99:Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.comGui,99:Font Gui,99:Show,,%applicationname% AbouthCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HANDOnMessage(0x200,"WM_MOUSEMOVE") Return 1HOURSOFTWARE: Run,http://www.1hoursoftware.com,,UseErrorLevelReturn DONATIONCODER: Run,http://www.donationcoder.com,,UseErrorLevelReturn AUTOHOTKEY: Run,http://www.autohotkey.com,,UseErrorLevelReturn 99GuiClose: Gui,99:Destroy OnMessage(0x200,"") DllCall("DestroyCursor","Uint",hCur)Return WM_MOUSEMOVE(wParam,lParam){ Global hCurs MouseGetPos,,,,ctrl If ctrl in Static13,Static17,Static21 DllCall("SetCursor","UInt",hCurs) Return}Return EXIT:ExitApp SETTINGS:Gosub,READINIRun,CAPshift.iniReturn READINI:IfNotExist,CAPshift.ini{ 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=Å FileAppend,%inifile%,CAPshift.ini inifile=}IniRead,capslockidle,CAPshift.ini,Settings,capslockidleIniRead,showstatus,CAPshift.ini,Settings,showstatusIniRead,delaycapslock,CAPshift.ini,Settings,delaycapslockIniRead,delayf1,CAPshift.ini,Settings,delayf1IniRead,delayinsert,CAPshift.ini,Settings,delayinsertIniRead,delayscrolllock,CAPshift.ini,Settings,delayscrolllockIniRead,delaynumlock,CAPshift.ini,Settings,delaynumlock If delaycapslock=1 Hotkey,$CapsLock,DELAYIf delayf1=1 Hotkey,$F1,DELAYIf delayinsert=1 Hotkey,$Insert,DELAYIf delaynumlock=1 Hotkey,$NumLock,DELAYIf delayscrolllock=1 Hotkey,$ScrollLock,DELAY swapcount=0Loop,Read,CAPshift.ini{ StringLeft,char,A_LoopReadLine,1 If char=`; Continue IfInString,A_LoopReadLine,[Settings] Continue If A_LoopReadLine Contains capslockidle=,showstatus=,delaycapslock=,delayf1=,delayinsert=,delayscrolllock=,delaynumlock= Continue IfNotInString,A_LoopReadLine,= Continue swapcount+=1 StringSplit,swap_%swapcount%_,A_LoopReadLine,=}Return
Navigation
[0] Message Index
Go to full version