AutoHotkey Community

It is currently May 27th, 2012, 6:06 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: July 29th, 2008, 6:52 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2008, 10:42 am 
Quote:
Are either of these options possible?
What about to try it?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2008, 11:55 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
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.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2008, 7:55 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2008, 10:45 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2008, 4:04 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2008, 6:22 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2008, 6:40 am 
use uberoptions, it uses autohotkey on it.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 1:11 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
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.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 2:43 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 6:28 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
you might be able to simply RegWrite to the right place to change the setting.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 3:52 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 11:04 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
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"

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 11:25 pm 
... + use a nick! :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2010, 6:53 pm 
Offline

Joined: April 24th, 2009, 7:06 pm
Posts: 87
Found the following Tool and put together some pieces of code:
http://nd.snackbox.org/pages/apps/mousespeed.html


Code:
Check_Current_Mouse_Speed_DPI:
Default_Mouse_Speed_DPI = 12

; Report the current mouse speed:
SPI_GETMOUSESPEED = 0x70
DllCall("SystemParametersInfo", UInt, SPI_GETMOUSESPEED, UInt, 0, UIntP, CurrentMouseSpeed, UInt, 0)
;%CurrentMouseSpeed%

If %CurrentMouseSpeed% != %Default_Mouse_Speed_DPI%
   {
   Runwait, %comspec% /c "SetMouseSpeed.exe %Default_Mouse_Speed_DPI%",, Hide
   }

Return



Best Regards,
Deep-Silence


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, dra, HotkeyStick, migz99, Wicked, XstatyK and 58 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group