Prevent right click when doing a left click. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Pawtz
Posts: 3
Joined: 07 Feb 2020, 17:32

Prevent right click when doing a left click.

07 Feb 2020, 20:12

I have an odd issue going on with my mouse where the right click is sometimes initiated when I do a left click.

It's driving me insane. I had issues with my last mouse in regards to double clicking, so I bought this one and now this one is having issues.


Anyone know of a script to prevent right click from being triggered when doing a left click?
Closest thing I found was this: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=71240&p=307891&hilit=left+click#p307891
but it's not quite what I need.


Thanks for any feedback. Seems autohotkey is the only thing that solves these issues people have (other than purchasing another mouse).
wbm1113
Posts: 18
Joined: 28 Aug 2018, 11:19

Re: Prevent right click when doing a left click.  Topic is solved

07 Feb 2020, 20:48

Code: Select all

#NoEnv
#SingleInstance, Force
#KeyHistory 0
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 2
SetBatchLines, -1
ListLines Off
Process, Priority, , A
SetKeyDelay, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1

global RightClickSuppress := 0
global TimerTicks := 0
return

~LButton::
    TimerTicks := 0
    SetTimer, StopRightClicks, 250
return

StopRightClicks:
    TimerTicks++
    RightClickSuppress := 1
    if(TimerTicks>1) { 
        RightClickSuppress := 0
        SetTimer, StopRightClicks, Off
    }
return

#If RightClickSuppress=1
    RButton::
    return
#If
Pawtz
Posts: 3
Joined: 07 Feb 2020, 17:32

Re: Prevent right click when doing a left click.

08 Feb 2020, 00:03

Thank you so much! Working like a charm so far! :superhappy:
Pawtz
Posts: 3
Joined: 07 Feb 2020, 17:32

Re: Prevent right click when doing a left click.

08 Feb 2020, 03:07

Still doing it a little bit now that I've tested it for a bit, but much more tolerable than before.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 412 guests