AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

control mouse DPI with autohotkey?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Tue Jul 29, 2008 5:52 am    Post subject: control mouse DPI with autohotkey? Reply with quote

Hi,

I've recently purchased a logitech G5 which has the capability to switch between the mouse dpi with its extra buttons.

What I wanted to know is if there is a way to access these buttons or this control through autohotkey? Setpoint only allows me to control the dpi through the mouse buttons. What I would like to do is create an autohotkey script that automatically switches to the preferred dpi per weapon when I am playing fps.

ie

1 sends 1 and dpi 1500
2 sends 2 and dpi 1000
3 sends 3 and dpi 500

So when I hit 1 to go to weapon 1, my dpi also toggles to 1500. When I hit 2 to go to weapon 2, it goes to that weapon and toggles the dpi to 1000. Etc.

I guess this could be achieved one of two ways. Either by directly sending these extra mouse buttons ( 6, 7, 8 ) within the script, or just directly binding the mouse dpi to keyboard keys and sending those.

Are either of these options possible?

It seemed like from what I've read searching this forum, autohotkey only recognizes up to xButton5.
Back to top
BoBo²
Guest





PostPosted: Tue Jul 29, 2008 9:42 am    Post subject: Reply with quote

Quote:
Are either of these options possible?
What about to try it?
Back to top
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Tue Jul 29, 2008 10:55 pm    Post subject: Reply with quote

Uberoptions is a tweak for Logitech Setpoint that allows rebinding of nearly all buttons on any logitech mouse. It will probably do what you want.
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
Guest






PostPosted: Sat Aug 09, 2008 6:55 pm    Post subject: Reply with quote

Bobo,

Your reply is pointless. Obviously I've been trying it and yet to find a solution. Please don't clutter up this thread with replies that aren't of any value.

VxE,

I tried uberoptions and while it does offer a lot more in terms of what I can bind to the mouse keys, I don't see any way to shift the dpi sensitivity control to a key that autohotkey recognizes. As soon as I change a button to dpi sensitivity control, it no longer functions as the physical key.

ie - if I make MButton a dpi control, and try to call MButton in an autohotkey script, it does not adjust the dpi sensitivity because according to Setpoint, MButton isn't 'linked' to that control (as far as I can tell). It's as if the option is not "MButton does this" but rather "I'm swapping out MButton for this function"

I've tried downloading scripts that will tell me the scancode/virtual key of whatever I hit, but no luck so far when hitting keys that are bound to dpi sensitivity.

Is there any other way to control mouse dpi (perhaps through windows) that I would be able to call within an autohotkey script? Or, does anyone know of a way that I can call setpoint's dpi sensitivity within autohotkey? If I only knew what the key was called, I could put it in my script.

Again, the scripting part isn't the problem. It's not knowing how to access the dpi sensitivity control so I can call it within my script.
Back to top
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Sat Aug 09, 2008 9:45 pm    Post subject: Reply with quote

You could try running FileMon or RegMon whilst setting the dpi to see if the settings are stored somewhere you can control with AutoHotkey.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Aug 13, 2008 3:04 am    Post subject: Reply with quote

I had a chance to run both filemon and regmon while hitting the dpi setting keys.

regmon seemed to provide more information. When switching to my fast dpi setting (2000 dpi), I get something like this
Code:

KHALMNPR.exe:1612 SetValue HKLM\System\CurrentControlSet\Enum\HID\ ... \Device Parameters\DpiIndex SUCCESS 0x2

KHALMNPR.exe:1612 SetValue HKLM\System\CurrentControlSet\Enum\HID\ ... \Device Parameters\DpiIndex SUCCESS 0x4

KHALMNPR.exe:1612 SetValue HKLM\System\CurrentControlSet\Enum\HID\ ... \Device Parameters\DpiIndex SUCCESS 0x4



And when I switch to my second dpi setting (1250 dpi) I get this

Code:

KHALMNPR.exe:1612 SetValue HKLM\System\CurrentControlSet\Enum\HID\ ... \Device Parameters\DpiIndex SUCCESS 0x4

KHALMNPR.exe:1612 SetValue HKLM\System\CurrentControlSet\Enum\HID\ ... \Device Parameters\DpiIndex SUCCESS 0x2

KHALMNPR.exe:1612 SetValue HKLM\System\CurrentControlSet\Enum\HID\ ... \Device Parameters\DpiIndex SUCCESS 0x2


So it seems like the difference lies in the final values, 0x4 for my first dpi setting and 0x2 for my second dpi setting.

I also ran a few tests where I only hit setting 1 while running regmon, and consistently got 0x4 as the SetValue. Same thing when only hitting setting 2, I consistently saw 0x2.

Any insight appreciated.
Back to top
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Wed Aug 13, 2008 5:22 am    Post subject: Reply with quote

Anonymous wrote:
Bobo,

Your reply is pointless. Obviously I've been trying it and yet to find a solution. Please don't clutter up this thread with replies that aren't of any value.
I believe Bobo's point is that you haven't posted any code that you have tried, which people could possibly use as a starting point for helping you. You'll notice if you look around the forums that he is also one of the biggest posters here Wink

My suggestion (if I'm reading your post correctly) is getting the virtual key code and scan code of the mouse keys (you can do this by running any script with a mouse hook running, and then looking in the key history) and then doing a simple remap. For example, this will send "1" and a left click
Code:
~1::vk01sc000

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Aug 13, 2008 5:40 am    Post subject: Reply with quote

use uberoptions, it uses autohotkey on it.
Back to top
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Thu Aug 14, 2008 12:11 am    Post subject: Reply with quote

Anonymous wrote:
ie - if I make MButton a dpi control, and try to call MButton in an autohotkey script, it does not adjust the dpi sensitivity because according to Setpoint, MButton isn't 'linked' to that control (as far as I can tell). It's as if the option is not "MButton does this" but rather "I'm swapping out MButton for this function"


If you've still got no good solution, I thought of one other thing you can try. Using Micha's HID Dll, you can have an AHK script catch HID messages from those buttons on your mouse, even while those buttons are bound to the mouse's DPI functions.
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Aug 14, 2008 1:43 am    Post subject: Reply with quote

VxE,

Very interesting. I'm going to have to check this out when I'm home from work. This might be what I'm looking for - thanks for the insightful reply.
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Aug 14, 2008 5:28 am    Post subject: Reply with quote

you might be able to simply RegWrite to the right place to change the setting.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Thu Aug 14, 2008 2:52 pm    Post subject: Reply with quote

I've tested Micha's HID Dll and while I was able to find my Logitech G5 on the list and register it, it didn't appear to recognize the dpi keys. It seems like someone with the same mouse as me experienced a similar issue in the thread you linked to.

RegWrite? I'll check it out. By this point I'm getting used to just using the dpi keys in synchronization with the number keys, but still it would be cool if there was a way I could combine them.

Thanks
Back to top
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Thu Aug 14, 2008 10:04 pm    Post subject: Reply with quote

Well, it's a long shot, but if you can tweak this file, this is where SetPoint keeps its button configurations, so, in theory, you can set your mouse buttons to do exactly what you want. But you'd have to do all your own fiddling.

Code:
run notepad.exe "%A_AppData%\Logitech\SetPoint\User.xml"

_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
Nickless
Guest





PostPosted: Thu Aug 14, 2008 10:25 pm    Post subject: Reply with quote

... + use a nick! Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group