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 

mouse buttons as hotkey

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





PostPosted: Tue Jan 01, 2008 6:38 pm    Post subject: mouse buttons as hotkey Reply with quote

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

PostPosted: Tue Jan 01, 2008 8:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mustang



Joined: 17 May 2007
Posts: 415
Location: England

PostPosted: Tue Jan 01, 2008 8:57 pm    Post subject: Reply with quote

[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 Sad

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
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2739
Location: Australia, Qld

PostPosted: Wed Jan 02, 2008 7:17 am    Post subject: Reply with quote

On Windows XP, my Logitech MX610's wheel tilt uses the mouse HID, but sends empty messages. Confused

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. Smile

(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
View user's profile Send private message
Byzoomi
Guest





PostPosted: Wed Jan 02, 2008 8:11 am    Post subject: Thanks! Reply with quote

lexikos wrote:
On Windows XP, my Logitech MX610's wheel tilt uses the mouse HID, but sends empty messages. Confused

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. Smile


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

PostPosted: Tue May 20, 2008 8:14 am    Post subject: Reply with quote

Doesn't anybody have any progress with hooking those horizontal scroll buttons with Logitech's dlls?
Back to top
View user's profile Send private message
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