AutoHotkey Community

It is currently May 27th, 2012, 12:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: November 21st, 2009, 12:41 am 
I am not an expert at it but this is the script I have so far as to demonstrate.
Code:
#NoEnv
#Persistent
#SingleInstance Force
SetTitleMatchMode 3
SetTitleMatchMode Fast

Loop,
{
  MouseGetPos,,,ID,NN
  WinGetClass,c,ahk_id %ID%
If (c="Progman" AND NN="SysListView321") OR (c="CabinetWClass" AND NN="SysListView321")
  Hotkey,*LButton,L1,On
Else If ! (c="Progman" AND NN="SysListView321") OR (c="Progman" AND NN="Edit1") OR (c="CabinetWClass" AND NN="SysListView321") OR (c="CabinetWClass" AND NN="Edit4")
  Hotkey,*LButton,L0,Off
} Return

L1:
  Hotkey,*LButton,Off
If (A_PriorHotKey=A_ThisHotKey AND A_TimeSincePriorHotkey<300)
  Click 2
Else
  Click
Return

L0:
  Hotkey,*LButton,On
Return

MButton::
  MouseGetPos,,,ID2,NN2
  WinGetClass,c2,ahk_id %ID2%
If (c2="Progman") OR (c2="CabinetWClass" AND NN2="SysListView321") {
  GetKeyState, SL, MButton, P
If SL=D
 {
   Send {LButton Down}
   KeyWait MButton, U T0.35
If ErrorLevel {
   KeyWait MButton, U
   Send {LButton Up}
  }
Else
  KeyWait MButton, D
  Send {LButton Up}
Return
 }
} Return

On running my script try the left click and drag, which is blocked. But you can still double click to open a file.
Now use MButton to drag a file by either click and release then drag OR clcik and drag then release.

The only thing I'm baffled is how to block a LButton slow double click on a file from prompting an edit on a file name.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2009, 12:44 am 
BTW... i forgot to mention that in my script the LButton still has the ussual access to everything else other than icons. I'm still yet to also add the same for the MButton... althought this is not always needed.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2009, 1:03 am 
I forgot to say remove "Edit1" and "Edit4' from my script... this is actually a script I wrote some time ago and these oppose what i am after.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2009, 1:34 am 
This is one I made roughly but doesnt contain direct acces to everything as LButton should. If someone wants to add it to this go right ahead as I'd be more than happy.

Click LButton on file and hold to get a tooltip and the rest is fairly self explanatory.

In this script I resorted to scrictly using LButton (MButton is not used as previous)

Code:
#NoEnv
#Persistent
#SingleInstance force
coordmode, mouse, screen

M_PIXELS = 5  ;no of pixels to trigger mouse movement

mousegetpos, sx, sy
return



#IfWinActive, ahk_class Progman
LButton::
{
IfWinActive, ahk_class Progman
KeyWait LButton, U T0.3
If ErrorLevel
{
ToolTip, Have It!
Send {LButton Down}
SetTimer, KillToolTip, 1000
KeyWait LButton, U T0.5
If ErrorLevel
{
KeyWait LButton, U
Send {LButton Up}
Return
}
Else
KeyWait LButton, D
Send {LButton Up}
Return
}
Else
IfWinNotActive, ahk_class Progman
Return
}
Return
#IfWinActive

KillToolTip:
SetTimer, KillToolTip, Off
ToolTip
Return


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], chaosad, Exabot [Bot], Google Feedfetcher, jrav, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group