ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Long left click as Right Click

(1/3) > >>

c.gingerich:
I think this may be my first request. :-)

I am trying to make an app that will allow me to long left click (time needs to be adjustable) and have it preform a right click (while the left button is still down, not when it is released). It also should only happen when the cursor is in the same place when it was first clicked (or within a pixel tolerance that should be adjustable also) so it doesn't happen while dragging.

I have created a AutoHotkey script that kind of works but not all the time and not everywhere.


--- ---~LButton::
MouseGetPos, x0, y0
SetTimer, check, -500
;MsgBox %xysum%
return

check:
MouseGetPos, x, y
if (x0 = x || y0 = y)
{
if GetKeyState("Lbutton", "P")
{
Click Right
;SendEvent, {Blind}{RButton Down}
;SendEvent, {Blind}{RButton Up}
;SendEvent, {Blind}{LButton Up}
return
}
}
return

If someone could modify this script or write one that works better that would be great!!

Thank you!!

c.gingerich:
Hmm... no one has an idea to get this to work or a better way to do it?

4wd:
I was going to do a quick check in AutoIt as it has some MouseEvent UDFs that let you hook into what the mouse is doing but unfortunately other things are currently getting in the way of doing anything useful  :-\

Next week I should be able to see if it can be done in AutoIt.

4wd:
OK, see if this works, (or formats your drive or something).

LMB2R - Left Mouse Button -> Right

Two files, an executable and a ini where you can specify the time delay and pixel tolerance.

Copy the files anywhere, rename them to anything you like.  Since it uses primary and secondary mouse buttons it'll also work if you've swapped buttons in the mouse config, (ie. you're a southpaw), in which case you might want to rename it to RMB2L  ;)

LMB2R.ini

--- Code: Text ---[Settings]Time=500Zone=5[Windows]Window1=CabinetWClass|EditWindow2=IEFrame|EditWindow3=Chrome_WidgetWin_1|Chrome_WidgetWin_1
Time = delay in milliseconds
Zone = pixel tolerance, (applies to both x and y direction - can separate that if you like)

It doesn't require the ini file to work, if the file doesn't exist it will default to values of 500ms and 5 pixels.

You can exit the program either by the tray icon menu or the hotkey Control+Alt+Shift+x, (the hotkey was purely for a "Get out of jail" in case the mouse started going weird - it can be removed when proven not necessary).

I'll post the code once I know it works :)

Addendum: Not really a bug but if you use it on a SysTray icon so that its menu opens and then LMB click on the Taskbar, you'll get the Taskbar menu.  Seems to be the only area in which this happens, I could probably get around it by area exclusion but it doesn't seem to cause any problems so I'm kind of reluctant to implement something to try to stop this behaviour.

UPDATE: v0.0.0.5
Add: Add Window/Control classname specific handling.
Add: Classnames.exe to help you get the above.

c.gingerich:
Thanks! Going to try it in a little while.

Navigation

[0] Message Index

[#] Next page

Go to full version