AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mouse Edit

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
MsgBox



Joined: 17 Nov 2005
Posts: 179
Location: Leicester, UK

PostPosted: Mon May 15, 2006 10:35 am    Post subject: Mouse Edit Reply with quote

Hello

This is for people who like me prefers to use the mouse rather than keyboard shortcuts for editing text.
It can also be used in explorer, though use at your own risk!

Code:
;________________________
; \____Mouse Edit_____/ 

;   By SlimlinE

; Hold down LButton and click RButton:-
;   Once to Copy
;   Twice to Paste
;   Three to Cut
; Hold down LButton and scroll MouseWheel:-
;   Down to Select All
;   Up to Undo
; Holding down LButton and clicking MouseWheel sends Enter
;
; Tip: Functions can be used one after another if LButton isn't released
;      ie.  Hold down LButton
;           scroll MouseWheel Down (Select All), click RButton once (Copy) etc.


; Cut Copy & Paste.

~LButton & RButton::
    If RMB_Click > 0
       {
         RMB_Click += 1
         Return
      }
   RMB_Click = 1
    SetTimer, WaitForClicks, 800
Return

WaitForClicks:
    SetTimer, WaitForClicks, Off
    If RMB_Click = 1
        {
            Send, {LButton Up}^c
           ClipWait,1
            String = %clipboard%

            TrayTip, ________ COPIED TO CLIPBOARD. _______, %String%
            SetTimer, RemoveTrayTip, 3000           
        }
    Else If RMB_Click = 2
        {
            Send, {LButton Up}^v
            String = %clipboard%

            TrayTip, ________ PASTED FROM CLIPBOARD. _______, %String%
            SetTimer, RemoveTrayTip, 2000           
        }
    Else If RMB_Click = 3
        {
            Send, {LButton Up}^x
            String = %clipboard%

            TrayTip, ________ CUT TO CLIPBOARD. _______, %String%
            SetTimer, RemoveTrayTip, 1000           
        }
    Else If RMB_Click > 3
        {
            Send, {LButton Up}

            TrayTip, ___ TOO MANY CLICKS! ___,Edit Aborted.
            SetTimer, RemoveTrayTip, 5000           
        }
    RMB_Click = 0
Return

RemoveTrayTip:
SetTimer, RemoveTrayTip, Off
TrayTip
Return


; Undo Enter & Select All.

~Lbutton & WheelUp::
    Send,{LButton Up}
    GetKeyState, State, WheelUp
    If State = U
        {
            Send,^z

            ToolTip, Undo
            SetTimer, RemoveToolTip, 2000
        }
Return
 
~LButton & WheelDown::
    Send,{LButton Up}
    GetKeyState, State, WheelDown
    If State = U
        {
            Send,^a
            ToolTip, Select All
            SetTimer, RemoveToolTip, 2000
        }
Return

~LButton & MButton::
    Send, {LButton Up}
    GetKeyState, State, MButton
    If, State = U
    Send, {Enter}
Return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
Return

;_________________________
; \____End Of Code____/
Back to top
View user's profile Send private message Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Mon May 15, 2006 11:10 am    Post subject: Reply with quote

Funny, lot of people prefer to have more keyboard shortcuts than using the mouse. Smile
Well, this is interesting and creative.
Side note: thrice word exists! Razz
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group