DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Triple-Click Mouse Utility  (Read 17,496 times)

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • Coding Snacks
IDEA: Triple-Click Mouse Utility
« on: May 05, 2007, 06:46 PM »
Hiya,

I've looked high and low for something like this, but to no avail.

I need a wee little thing that sits in the task bar and detects mouse triple-clicks.  Upon triple-click, it converts the action into a predefined hotkey / keystroke.  For instance, convert triple-click into SHIFT-F2.

Make sense?  Whattaya think?

Thanks,
Ralf

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: IDEA: Triple-Click Mouse Utility
« Reply #1 on: May 05, 2007, 11:51 PM »
Seems like it could be useful to me, at least for some apps.  i wonder if any of the mouse gesture utilities (stroke it) have anything like this already?

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: IDEA: Triple-Click Mouse Utility
« Reply #2 on: May 06, 2007, 04:43 PM »
Hi Ralf,
there are various mouse gesture programs that I think could do that. In addition to StrokeIt that Mouse mentioned Autohotkey (http://www.autohotkey.com ) is capable of mouse gesture scripts ( http://www.autohotkey.com/docs/scripts/MouseGestures.htm ).

Triple left clicks might be complicated to implement since I suppose you would still want to use single and double clicks in many contexts. So the script must often let those through but not in those cases where you want the triple click functionality.

One alternative would be to instead make a mouse middle button gesture. For example, when you hold the mouse middle button and at the same time drag the mouse up, window sends SHIFT-F2. There are two advantages here: Middle mouse clicks are seldom used in window applications so there are fewer possible conflicts. Also, holding middle mouse button and moving the mouse might be less tiring than triple clicking (I at least get tired in my right arm quickly when I do a lot of double clicking so triple would be even worse).

I made such a script for Autohotkey that sends SHIFT-F2 on middle mouse press + mouse move up. You could try it and see if it fits your needs:
Code
~MButton::
MouseGetPos, OutputVarX, OutputVarY
sleep, 100
MouseGetPos, OutputVarXB, OutputVarYB
GetKeyState, state, MButton
if state = D
{
ydiff := OutputVarY - OutputVarYB
if ydiff > 50
Send +{F2}
}
« Last Edit: May 06, 2007, 04:46 PM by Nod5 »

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • Coding Snacks
Re: IDEA: Triple-Click Mouse Utility
« Reply #3 on: May 07, 2007, 12:30 AM »
I installed StrokeIt and configured it the way I want.  No triple-click (obviously) but now I've got a gesture that does what I need.  Thanks!

Programmy my middle button to do something would be great, but this particular mouse (el cheapo Dell) has a hard time discerning between middle-click and a scroll.  Sometimes I get both, sometimes neither.  So alas, I must stay away from my middle button.  Which kind of sounds naughty but rest assured, it's not.

I'd still like a triple-click thingie, but I can live without it.  I recognize it's a hard thing to detect and also many applications (MS Word) use triple-click to mean "select a whole phrase" so it'd be fun fighting that.  In my case, I only need it available in one app, and it ain't Word.  :-)

Thanks again for the awesome lead -- I wouldn't have found StrokeIt on my own.  Which, again, sounds naughty but it's not...

Regards,
Ralf

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: IDEA: Triple-Click Mouse Utility
« Reply #4 on: May 07, 2007, 07:55 AM »
Ralf,
glad to hear StrokeIt is working for you... Here's a triple click script for Autohotkey. It lets all clicks through to windows so watch out for accidental single/double click commands when trying to triple click. Also, it only sends the command tied to triple click if a certain process has focus (notepad.exe below, change that to whatever process name you want to send SHIFT + F2 to)

Code
~LButton::
WinGet, xproc, ProcessName, A
if xproc != notepad.exe
 return

if t1 = 
 {
 t1 = %A_Now%
 return
 }

if t2 = 
 {
 if (A_Now - t1) < 1
   t2 = %A_Now%
 else
   t1 =
 return
 }

if (A_Now - t1) < 1
 {
 Send +{F2}
 t1 =
 t2 = 
 return
 }

t1 = %A_Now%
t2 =
« Last Edit: May 07, 2007, 07:58 AM by Nod5 »

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • Coding Snacks
Re: IDEA: Triple-Click Mouse Utility
« Reply #5 on: May 07, 2007, 12:58 PM »
W00t!  Thanks!  I'm off to compile me some AutoHotKey macro!

Ralf

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • Coding Snacks
Re: IDEA: Triple-Click Mouse Utility
« Reply #6 on: May 08, 2007, 01:13 PM »
Worked like a champ.  And doesn't interfere with single or double clicks.  Thanks!

Ralf

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: IDEA: Triple-Click Mouse Utility
« Reply #7 on: May 09, 2007, 05:33 PM »
Great that it works for you!  :) You can also easily modify the script to send other commands when other applications have focus.

aidan_cage

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 27
Re: IDEA: Triple-Click Mouse Utility
« Reply #8 on: October 20, 2009, 09:06 PM »
is there a way to make this script global so that when I triple click I send a window key signal (bringing up my taskbar)? would I just make the process explorer.exe?

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: Triple-Click Mouse Utility
« Reply #9 on: October 20, 2009, 09:27 PM »
is there a way to make this script global so that when I triple click I send a window key signal (bringing up my taskbar)? would I just make the process explorer.exe?

Try this:

Code: (autoit)
Timeout = 400 ; In milliseconds.  Adjust as necessary.

~LButton::
{
    If ( A_ThisHotkey = A_PriorHotkey AND A_TimeSincePriorHotkey < Timeout )
    {
        ClickCount++
    }
    Else
    {
        ClickCount = 1
    }
    SetTimer, ClickHandler, % Timeout
}
Return

ClickHandler:
{
    SetTimer, ClickHandler, Off
    If ( ClickCount = 3 )
    {
        Send, {LWin}
    }
}
Return 

Original address: https://www.donationcoder.com/forum/index.php?topic=8377.0