DonationCoder.com Software > TapTap
[SOLVED, kinda] CTRL-C shortcut not recognized in Win7-Explorer
damax:
OKAY! I finally found some time and solved my problem. (No, I haven't. See update).
As IanB suggested I used AutoHotKey, created a script, compiled it et voilĂ ... it works. Better than ever ;)
If anyone's interested, here's the AHK code:
--- Code: Autohotkey ---; AHK Script to redirect Double-Shift to Ctrl+C and Double-Ctrl to Ctrl+V; Idea came from this Reddit: https://www.reddit.com/r/AutoHotkey/comments/44pn3m/double_tap_short_cut/; done by daMax (//todamax.net) Shift:: if (A_PriorHotkey = "Shift" AND A_TimeSincePriorHotkey < 250) { ; MsgBox double-click Shift. Send, ^c } else { ; no double-click. just wait for the key to be released and move on with your life KeyWait, Shift return} Control:: if (A_PriorHotkey = "Control" AND A_TimeSincePriorHotkey < 250) { ;MsgBox double-click Control. Send, ^v } else { ; no double-click. just wait for the key to be released and move on with your life KeyWait, Control return}
This now seems to work in Windows Explorer, Notepad, Firefox etc.
I uploaded the finished EXE to my blog:
http://blog.todamax.net/wp-content/uploads/2016/09/daMaxCopyPaste.zip
You can also find the script there: http://blog.todamax.net/wp-content/uploads/2016/09/daMaxCopyPaste.ahk
Update: aahrg! It's no good :( now the Shift-Key doesn't work "on its own" anymore, so I cannot Shift keys at all. FAIL :(
IainB:
@damax: Argh!! I don't think I was recommending that!!
Keep it simple. You don't need TapTap.
You might not need the ClipWait, but I put it in there just-in-case.
Try:
--- --->^m:: ; RightCtrl+m is to send <^c (COPY)
Send, ^c
ClipWait, 2 ; wait for up to 2 seconds for state change before proceeding, so as to ensure capture to clipboard
Return
>^n:: ; RightCtrl+n is to send <^v (PASTE)
Send, ^v
Return
By the way, I discovered that OkayKeybees v1.04a does not seem to work under Win10-64, so don't bother with it.
As I said, I can't actually test this to prove it as I have my RtCtrl key mapped to something else. You should be able to test it OK though, I think.
Do you need any help with editing your Autohotkey.ahk file?
If you do, then post it here as a generic script (press the # button whilst in edit mode, on the website).
There's lots of people here can help you.
damax:
@IanB: Ooooh. That's a nice and clean solution. Alas, I'd really like a Double-Tap-thing like it was in TapTap ('cos RCtrl+m and even worse RCtrl+n are still quite awkward key-combos to use), so I tried to do it with RapidHotKey. Which kinda works although it's quite an ugly script...
--- Code: Autohotkey ---; thanks to https://autohotkey.com/board/topic/35566-rapidhotkey/ ~RShift::RapidHotkey("^c", 2, 0.1) ;COPY~RControl::RapidHotkey("^v", 2, 0.1) ;PASTE RapidHotkey(keystroke, times="2", delay=0.2, IsLabel=0){ Pattern := Morse(delay*1000) If (StrLen(Pattern) < 2 and Chr(Asc(times)) != "1") Return If (times = "" and InStr(keystroke, """")) { Loop, Parse, keystroke,"" If (StrLen(Pattern) = A_Index+1) continue := A_Index, times := StrLen(Pattern) } Else if (RegExMatch(times, "^\d+$") and InStr(keystroke, """")) { Loop, Parse, keystroke,"" If (StrLen(Pattern) = A_Index+times-1) times := StrLen(Pattern), continue := A_Index } Else if InStr(times, """") { Loop, Parse, times,"" If (StrLen(Pattern) = A_LoopField) continue := A_Index, times := A_LoopField } Else if (times = "") continue := 1, times := 2 Else if (times = StrLen(Pattern)) continue = 1 If !continue Return Loop, Parse, keystroke,"" If (continue = A_Index) keystr := A_LoopField Loop, Parse, IsLabel,"" If (continue = A_Index) IsLabel := A_LoopField hotkey := RegExReplace(A_ThisHotkey, "[\*\~\$\#\+\!\^]") IfInString, hotkey, %A_Space% StringTrimLeft, hotkey,hotkey,% InStr(hotkey,A_Space,1,0) backspace := "{BS " times "}" keywait = Ctrl|Alt|Shift|LWin|RWin Loop, Parse, keywait, | KeyWait, %A_LoopField% If ((!IsLabel or (IsLabel and IsLabel(keystr))) and InStr(A_ThisHotkey, "~") and !RegExMatch(A_ThisHotkey , "i)\^[^\!\d]|![^\d]|#|Control|Ctrl|LCtrl|RCtrl|Shift|RShift|LShift|RWin|LWin|Alt|LAlt|RAlt|Escape|BackSpace|F\d\d?|" . "Insert|Esc|Escape|BS|Delete|Home|End|PgDn|PgUp|Up|Down|Left|Right|ScrollLock|CapsLock|NumLock|AppsKey|" . "PrintScreen|CtrlDown|Pause|Break|Help|Sleep|Browser_Back|Browser_Forward|Browser_Refresh|Browser_Stop|" . "Browser_Search|Browser_Favorites|Browser_Home|Volume_Mute|Volume_Down|Volume_Up|MButton|RButton|LButton|" . "Media_Next|Media_Prev|Media_Stop|Media_Play_Pause|Launch_Mail|Launch_Media|Launch_App1|Launch_App2")) Send % backspace If (WinExist("AHK_class #32768") and hotkey = "RButton") WinClose, AHK_class #32768 If !IsLabel Send % keystr else if IsLabel(keystr) Gosub, %keystr% Return}Morse(timeout = 400) { ;by Laszo -> http://www.autohotkey.com/forum/viewtopic.php?t=16951 (Modified to return: KeyWait %key%, T%tout%) tout := timeout/1000 key := RegExReplace(A_ThisHotKey,"[\*\~\$\#\+\!\^]") IfInString, key, %A_Space% StringTrimLeft, key, key,% InStr(key,A_Space,1,0) If Key in Shift,Win,Ctrl,Alt key1:="{L" key "}{R" key "}" Loop { t := A_TickCount KeyWait %key%, T%tout% Pattern .= A_TickCount-t > timeout If(ErrorLevel) Return Pattern If key in Capslock,LButton,RButton,MButton,ScrollLock,CapsLock,NumLock KeyWait,%key%,T%tout% D else if Asc(A_ThisHotkey)=36 KeyWait,%key%,T%tout% D else Input,pressed,T%tout% L1 V,{%key%}%key1% If (ErrorLevel="Timeout" or ErrorLevel=1) Return Pattern else if (ErrorLevel="Max") Return }}
Thank a TON for your support so far.
Navigation
[0] Message Index
[*] Previous page
Go to full version