 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Byzoomi Guest
|
Posted: Tue Jan 01, 2008 6:38 pm Post subject: mouse buttons as hotkey |
|
|
| I have a logitech V470 bluetooth mouse that i paired with bluetooth. The scroller has left and right tilt which I would like to use as a hotkey to move forward and backward in my browser (Alt-left and Alt-right). However, even with InstallMouseHook and InstallKeybdHook, pushing the scroller left and right produces nothing in the key history. Any suggestions how I can accomplish this without installing the logitech software that came with it (I hate logitech software). Thanks |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1499
|
Posted: Tue Jan 01, 2008 8:45 pm Post subject: |
|
|
Logitech mice with more than 5 buttons generally use a virtual HID to interface the extra buttons with windows. That means that AHK might not detect some buttons on Logitech mice, whatever you do.
Fortunately, another AHK user decided to tweak the Logitech firmware and gave us UberOptions. That should let you redefine your mouse's extra buttons. _________________ 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 |
|
 |
Mustang
Joined: 17 May 2007 Posts: 415 Location: England
|
Posted: Tue Jan 01, 2008 8:57 pm Post subject: |
|
|
| [VxE] wrote: | Logitech mice with more than 5 buttons generally use a virtual HID to interface the extra buttons with windows. That means that AHK might not detect some buttons on Logitech mice, whatever you do.
Fortunately, another AHK user decided to tweak the Logitech firmware and gave us UberOptions. That should let you redefine your mouse's extra buttons. |
UberOptions is great and I couldn't survive without it
But it still requires having the dreaded "Logitech Software" installed
P.S.
This thread has a solution that involves SetPoint combined with UberOptions
http://www.autohotkey.com/forum/viewtopic.php?t=20648 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Wed Jan 02, 2008 7:17 am Post subject: |
|
|
On Windows XP, my Logitech MX610's wheel tilt uses the mouse HID, but sends empty messages.
Windows Vista natively supports horizontal scrolling, via WM_MOUSEHWHEEL. Wheel tilt can be detected on Vista via a HID script or mouse hook. Since AutoHotkey ignores the WM_MOUSEHWHEEL message, a separate mouse hook must be installed via script:
| Code: | #Persistent
mhook := DllCall("SetWindowsHookEx", "int", 14 ; WH_MOUSE_LL
, "uint", RegisterCallback("WheelHorzHook"), "uint", 0, "uint", 0)
return
WheelLeft:
MsgBox WheelLeft
return
WheelRight:
MsgBox WheelRight
return
WheelHorzHook(nCode, wParam, lParam)
{
global mhook
Critical
if (wParam = 0x020E) ; WM_MOUSEHWHEEL (Vista-only)
{
if (delta := NumGet(lParam+0,10,"Short"))
{
if (delta<0) {
SetTimer, WheelLeft, -1
return true
} else {
SetTimer, WheelRight, -1
return true
}
}
}
return DllCall("CallNextHookEx", "uint", mhook, "int", nCode, "uint", wParam, "uint", lParam)
}
|
Fortunately for me, I use Vista almost exclusively. I also use a HID script to detect the "chat" button on my mouse.
(Edit: Added WH_MOUSE_LL keyword for search engines...)
Last edited by Lexikos on Sat Mar 22, 2008 7:10 am; edited 1 time in total |
|
| Back to top |
|
 |
Byzoomi Guest
|
Posted: Wed Jan 02, 2008 8:11 am Post subject: Thanks! |
|
|
| lexikos wrote: | On Windows XP, my Logitech MX610's wheel tilt uses the mouse HID, but sends empty messages.
Windows Vista natively supports horizontal scrolling, via WM_MOUSEHWHEEL. Wheel tilt can be detected on Vista via a HID script or mouse hook. Since AutoHotkey ignores the WM_MOUSEHWHEEL message, a separate mouse hook must be installed via script:
| Code: | #Persistent
mhook := DllCall("SetWindowsHookEx", "int", 14
, "uint", RegisterCallback("WheelHorzHook"), "uint", 0, "uint", 0)
return
WheelLeft:
MsgBox WheelLeft
return
WheelRight:
MsgBox WheelRight
return
WheelHorzHook(nCode, wParam, lParam)
{
global mhook
Critical
if (wParam = 0x020E) ; WM_MOUSEHWHEEL (Vista-only)
{
if (delta := NumGet(lParam+0,10,"Short"))
{
if (delta<0) {
SetTimer, WheelLeft, -1
return true
} else {
SetTimer, WheelRight, -1
return true
}
}
}
return DllCall("CallNextHookEx", "uint", mhook, "int", nCode, "uint", wParam, "uint", lParam)
}
|
Fortunately for me, I use Vista almost exclusively. I also use a HID script to detect the "chat" button on my mouse.  |
I use vista, and this works like a charm! And no logitech software either! Thanks a lot! |
|
| Back to top |
|
 |
steliyan
Joined: 20 Apr 2007 Posts: 31
|
Posted: Tue May 20, 2008 8:14 am Post subject: |
|
|
| Doesn't anybody have any progress with hooking those horizontal scroll buttons with Logitech's dlls? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|