Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Logitech - mouse buttons combination


  • Please log in to reply
5 replies to this topic
urosmil
  • Members
  • 7 posts
  • Last active: Jul 01 2007 07:23 PM
  • Joined: 30 Jun 2007
Hi,

has anyone succeed in detecting Logitech WheelRight and WheelLeft events?
Any successful combination is welcome (uberOptions, WinLIRC, ...)!
I want to handle RMouse+WheelRight and RMouse+WheelLeft events BUT without losing WheelRight and WheelLeft from SetPoint software!

Thanks,
Uros!

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
unless they show up in the key history, you probably can't detect it without losing the other function of it, unless you make AHK replicate the missing function.

urosmil
  • Members
  • 7 posts
  • Last active: Jul 01 2007 07:23 PM
  • Joined: 30 Jun 2007
Hi engunneer,

if you talking about history from AutoHatkey that event isn't showed, but in that history only registered events appears (there is no information if I even pres any key on keyboard)?
Is id possible to use WheelRight/WheelLeft in ahk if they are detected by some other tool (Winspector - never used it, just saw it mentioned on forum)?

Thanks,
Uros!

ManaUser
  • Members
  • 1121 posts
  • Last active: Dec 07 2016 04:24 PM
  • Joined: 24 May 2007
If your script has installed a mouse or keyboard hook, using the #InstallMouseHook and #InstallKeybdHook directives or for some other reason, in theory even unhandled keys will show up on the "Key history and script info" screen.

However, I have a mouse like that myself and couldn't get anything from tilting the wheel.

urosmil
  • Members
  • 7 posts
  • Last active: Jul 01 2007 07:23 PM
  • Joined: 30 Jun 2007
Hi,

I used code found on forum:
~LButton & WheelDown::Send !{Left}
~LButton & WheelUp::Send !{Right}
;~LButton & MButton::Send ; pokretanje web aplikacije

~RButton & WheelDown::Send ^v ; past
RButton & WheelUp::Send ^c ; copy
RButton & MButton::Send ^x ; cut


F13::  ; Turning the wheel up scrolls to the left.
    SetTitleMatchMode, 2
    IfWinActive, Microsoft Excel -
    {
        SetScrollLockState, on
        send,{left}
        SetScrollLockState, off
    }
    else IfWinActive, Adobe Acrobat Professional -
    {
        send,+{left}
    }
    else IfWinActive, - Mozilla Firefox
    {
        send,{left}
    }
    else IfWinActive, - Microsoft Word
    {
        send,^{left}    ; move to next word wince I haven't figured out how to scroll horizontally using the keyboard
    }
    else
    {
        ControlGetFocus, FocusedControl, A
        SendMessage, 0x114, 0, 0, %FocusedControl%, A  ; 0x114 is WM_HSCROLL ; 1 vs. 0 causes SB_LINEDOWN vs. UP
    }
return

F14::   ; Turning the wheel down while holding the back button scrolls to the right.
    SetTitleMatchMode, 2
    IfWinActive, Microsoft Excel -
    {
        SetScrollLockState, on
        send,{right}
        SetScrollLockState, off
    }
    else IfWinActive, Adobe Acrobat Professional -
    {
        send,+{right}
    }
    else IfWinActive, - Mozilla Firefox
    {
        send,{right}
    }
    else IfWinActive, - Microsoft Word
    {
        send,^{right}    ; move to next word wince I haven't figured out how to scroll horizontally using the keyboard
    }
    else
    {
        ControlGetFocus, FocusedControl, A
        SendMessage, 0x114, 1, 0, %FocusedControl%, A  ; 0x114 is WM_HSCROLL ; 1 vs. 0 causes SB_LINEDOWN vs. UP
    }
return 

RButton & F13::Send ^o ; quick outline
RButton & F14::Send ^t ; quick type hierarchy
to achieve what I want. But there is one problem: there is no acceleration for WheelRight/WheelLeft - when I pres and hold WheelRight/WheelLeft I get just one position move.
Is it possible to modify code to get continuous move when hold tilt buttons?

Thanks,
Uros!

urosmil
  • Members
  • 7 posts
  • Last active: Jul 01 2007 07:23 PM
  • Joined: 30 Jun 2007
Hi,

I succeed to create tilt acceleration.
This is what I did:

1) with uberOption (extenxion for SetPoint) change mapping (option- Keys:Keystroke Assignment) for left and right tilt to left="Shift+Ctrl+Alt+," and right="Shift+Ctrl+Alt+.". I used this combination because it's unused in my environment.

2) create new mapping in ahk. This is the code:
; LEFT HSCROLL
+^!,:: 
	TiltLeftLoop := False
	delta := 0
	period := 30
	Loop,
	  {
    	    If TiltLeftLoop
    	    	Break
    	    ControlGetFocus, FocusedControl, A
    	    SendMessage, 0x114, 0, 0, %FocusedControl%, A  ; 0x114 is WM_HSCROLL ; 1 vs. 0 causes SB_LINEDOWN vs. UP
    	    sleep (period - delta)
	    If (period - delta) > 5
	    	delta := delta + 10
  	  }
	return 
+^!, UP:: TiltLeftLoop := True


; RIGHT HSCROLL
+^!.::
	TiltRightLoop := False
	delta := 0
	period := 30
	Loop,
  	  {
    	    If TiltRightLoop
    	    Break
    	    ControlGetFocus, FocusedControl, A
    	    SendMessage, 0x114, 1, 0, %FocusedControl%, A  ; 0x114 is WM_HSCROLL ; 1 vs. 0 causes SB_LINEDOWN vs. UP
    	    sleep (period - delta)
	    If (period - delta) > 5
	    	delta := delta + 10
  	  }
	return
+^!. UP:: TiltRightLoop := True
There code is just for apps that understands WM_HSCROLL, for other (Firefox and other) look code in previous post in this threat or in other threads in this forum.

If question is why did I do this, the answer is: Now I can use tilt buttons in combination with other. Look this code:
LButton & +^!.::Send ^o ; quick outline
LButton & +^!,::Send ^t ; quick type hierarchy

Thanks,
Uros!