Programming a "Sniper" button

Discussion on Computer Hardware & Custom Builds
Post Reply
smgunsftw
Posts: 242
Joined: 2012-10-26 21:43

Programming a "Sniper" button

Post by smgunsftw »

I recently got the Gigabyte GM-M6880 mouse off of NCIX, and I'm satisfied with its performance per dollar ($25). It's got a 3 stage DPI adjustment button as well as two forward and back buttons. However, I'm trying to program one of the buttons on the sides to act as a "sniper" button, which is basically a button that decreases your sensitivity whenever it is held down. The software that is included with the mouse doesn't support this feature at the moment.

I've searched other websites for tips on how to do this, and ended up making it work with an AutoHotKey script. The only problem is that the button only works when I'm browsing the internet or using Windows Explorer. Whenever I start a game, whether it be PR, GTA:SA, Company of Heroes, etc. the button does not work any more.

Does anyone know why this is happening? Is this is a intended effect to prevent hacking, or a software/programming error on my part?

This is my mouse AHK configuration:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <[email protected]>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#InstallMouseHook
#Persistent
SPI_GetMouseSpeed:= 0x70
SPI_SetMouseSpeed:= 0x71
DesiredMouseSpeed:= 3 ; use 1 to 20, default is 10
XButton2::
DllCall("SystemParametersInfo", UInt, SPI_GetMouseSpeed, UInt, 0, UIntP, OrigMouseSpeed, UInt, 0)
DllCall("SystemParametersInfo", UInt, SPI_SetMouseSpeed, UInt, 0, UInt, DesiredMouseSpeed, UInt, 0)
DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, OrigMouseSpeed, UInt, 0)
Return
PLODDITHANLEY
Posts: 3608
Joined: 2009-05-02 19:44

Re: Programming a "Sniper" button

Post by PLODDITHANLEY »

I just switch dpi up for turrets down for long range aiming.
smgunsftw
Posts: 242
Joined: 2012-10-26 21:43

Re: Programming a "Sniper" button

Post by smgunsftw »

But still, would you rather have a sniper button that allows you to change DPI within a few milliseconds, or having to scroll through all the settings on your DPI selector?
PLODDITHANLEY
Posts: 3608
Joined: 2009-05-02 19:44

Re: Programming a "Sniper" button

Post by PLODDITHANLEY »

To me with my G9 once up or down is enough.
Vicious302
Posts: 407
Joined: 2010-07-28 19:54

Re: Programming a "Sniper" button

Post by Vicious302 »

I just can't imagine the need for this. You need to find a sweet spot that works for everything. Like same thing with the mumble volume situation, but non the less I hope you find whatever results your looking for, goodluck.
Post Reply

Return to “Hardware”