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
- Hotkey "^1", Exit
- Hotkey "^2", ClipCopy
- Hotkey "Right", CursorCopy
- CursorCopy(ThisHotkey){
- if(CC.toggled == 1 and CC.isCopying == 0){
- CC.copy()
- }
- else if(CC.toggled == 0){
- Send "{Right}"
- }
- }
- CC := CursorCopier()
- ClipCopy(ThisHotkey){
- CC.toggle()
- if(CC.toggled == 1){
- Tooltip "Toggle Enabled"
- }
- else{
- Tooltip
- }
- }
- CopyClipBoard(){
- ;ToolTip "Copy Clipboard"
- s := "^c"
- Send Format("{1}", s)
- }
- Exit(ThisHotkey){
- ExitApp
- }
- class CursorCopier {
- stringBuffer := ""
- toggled := 0
- isCopying := 0
- toggle(){
- if(this.toggled == 0){
- this.toggled := 1
- this.stringBuffer := ""
- A_Clipboard := ""
- }
- else{
- this.toggled := 0
- if(this.stringBuffer != ""){
- A_Clipboard := this.stringBuffer
- }
- }
- }
- copy(){
- this.isCopying := 1
- Send "+{Right}"
- Sleep 25
- CopyClipBoard()
- Sleep 25
- Send "{Right}"
- this.stringBuffer := Format("{1}{2}", this.stringBuffer, A_Clipboard)
- this.isCopying := 0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement