Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Requires AutoHotkey v2.0
- #InputLevel 1
- #SingleInstance Force
- PID := DllCall("GetCurrentProcessId")
- ProcessSetPriority "High", PID
- specialKey := "1"
- Hotkey "^9", Exit
- Hotkey Format("{1}",specialKey), ClipCopy
- clip := CopyClipBoardClass()
- ClipCopy(ThisHotkey){
- clip.copy()
- }
- Exit(ThisHotkey){
- ExitApp
- }
- class CopyClipBoardClass {
- keyPressesRequired := 2
- countKeyPresses := 0
- timeStarted := A_TickCount
- delayTime := 200
- _new(){
- }
- copy(){
- if(this.countKeyPresses == 0){
- this.timeStarted := A_TickCount
- this.countKeyPresses += 1
- SetTimer CheckKeyTime, 10
- }
- else if(this.countKeyPresses == this.keyPressesRequired - 1 && A_TickCount - this.timeStarted <= this.delayTime){
- this.countKeyPresses := 0
- Send "^c"
- ;MsgBox "Test2"
- }
- else if(this.countKeyPresses > 0 && A_TickCount - this.timeStarted > this.delayTime){
- this.countKeyPresses := 0
- }
- else{
- this.countKeyPresses += 1
- }
- ;Tooltip Format("{1}`n{2}`n{3}", this.countKeyPresses, this.timeStarted, A_TickCount)
- }
- }
- CheckKeyTime(){
- static numberT := 0
- if(clip.countKeyPresses == 1 && A_TickCount - clip.timeStarted > clip.delayTime){
- clip.countKeyPresses := 0
- Send Format("{1}", specialKey)
- ;ToolTip "Sending 1"
- SetTimer CheckKeyTime, 0
- }
- ;ToolTip Format("{1}",numberT)
- numberT += 1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement