| View previous topic :: View next topic |
| Author |
Message |
dantown Guest
|
Posted: Tue Jun 21, 2005 8:08 am Post subject: Rocker gestures |
|
|
Hallo,
holding the left mouse button and clicking the right one and vice versa is called a rocker gesture. It's available in Maxthon and other browsers. I'd like to implement this in Windows Explorer. Unfortunately, | Code: | RButton & LButton::send !{left}
LButton & RButton::send !{right} | does work but hinders any single left/right click system-wide. What have I done wrong?
Daniel |
|
| Back to top |
|
 |
AiKscroll
Joined: 06 Jun 2005 Posts: 179 Location: Northern Virginia
|
Posted: Tue Jun 21, 2005 9:02 am Post subject: |
|
|
A IfWinActive, Windows Explorer command may help... iono would it? _________________ _AiK |
|
| Back to top |
|
 |
dantown Guest
|
Posted: Tue Jun 21, 2005 9:52 am Post subject: |
|
|
| True, I'll have to check if Windows Explorer has focus. Nevertheless, even in Explorer I can't select anything with a left or right click. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10667
|
Posted: Tue Jun 21, 2005 11:10 am Post subject: |
|
|
Try adding a tilde in front of each hotkey. That allows the first button to pass through to the system normally:
~RButton & LButton::send !{left}
~LButton & RButton::send !{right}
The second one might still fail to work because most apps refuse to accept keystrokes while the left mouse button is down (or perhaps this is a built-in behavior for the entire system).
If that is the case, try:
~LButton & RButton::send {LButton Up}!{right}
If that doesn't work, try accomplishing the second hotkey's action via MouseClick, ControlClick, or WinMenuSelectItem. |
|
| Back to top |
|
 |
dantown Guest
|
Posted: Wed Jun 22, 2005 6:44 am Post subject: |
|
|
Thanks Chris, your last tip was amazing and works with both mouse click combinations. One problem persists: | Code: | | ~RButton & LButton::send {RButton Up}!{left} | opens the context menu. Any way to avoid this? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10667
|
Posted: Wed Jun 22, 2005 8:34 pm Post subject: |
|
|
The following seems to work:
| Code: | ~RButton & LButton::
Send !{left}
KeyWait, RButton ; Wait for physical release because that is often what shows the menu.
WinWait, ahk_class #32768, , 1 ; Menu's "window" (never active, but it does exist).
if not ErrorLevel ; Menu found.
Send {Escape}
return |
Maybe there is some other solution involving sending the WM_CANCELMODE to dismiss the menu, but that is a long shot and would take some research. |
|
| Back to top |
|
 |
dantown Guest
|
Posted: Thu Jun 23, 2005 4:35 pm Post subject: |
|
|
Thank you! That works except that I have to move "Send !{left}" right before "return".
It's a shame that the context menu is popping up though. The problem is that the right click is passed on to the system. Another problem is that your code waits until the right mouse button is released which is not the case with the other rocker gesture.
I'm thinking of a routine that takes care of the right click alltogether. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10667
|
Posted: Fri Jun 24, 2005 3:13 am Post subject: |
|
|
| dantown wrote: | | The problem is that the right click is passed on to the system. | I think this could be avoided by removing the tilde prefix from RButton and adding the following additional hotkey:
RButton::MouseClick, right,,,,, U ; Use MouseClick vs. Send to avoid disruption of Ctrl/Alt/Shift keys.
However, the above would prevent right-click-drag from working and might have other side effects.
| Quote: | | Another problem is that your code waits until the right mouse button is released which is not the case with the other rocker gesture. | Some apps, such as Explorer, display the context menu only upon release of the right mouse button. That's why the KeyWait is in there. |
|
| Back to top |
|
 |
dantown Guest
|
Posted: Mon Jun 27, 2005 3:34 pm Post subject: This rocks! |
|
|
For now I got the ultimate answer, which really rocks
In AutoHotkey, define | Code: | | ~LButton & RButton::send {LButton Up}!{right} |
In StrokeIt (http://www.tcbmi.com/strokeit/), add under [Global actions] the command "Back [Rocker right-left]" with the gesture "LBUTTON_DOWN" and hotkey "ALT + LEFT".
This gives you perfect forward/backward rocking featuring right-click dragging without the context menu bug.
Chris, you're doing a wonderful job, but I ask myself why it takes StrokeIt for the right-left click rocker gesture to work perfectly. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10667
|
Posted: Mon Jun 27, 2005 10:38 pm Post subject: Re: This rocks! |
|
|
| dantown wrote: | | ...but I ask myself why it takes StrokeIt for the right-left click rocker gesture to work perfectly. | Since mouse buttons already have so many functions, getting them to do more -- especially in combination with other mouse buttons -- is often tricky business. I'm glad you found a solution. |
|
| Back to top |
|
 |
stevo54321 Guest
|
Posted: Mon May 26, 2008 3:37 am Post subject: |
|
|
Instead of using the right button i just opted to use the scroll wheel. it's a little more annoying to press, but you don't get the context menu at all... a trade off i guess.
~LButton & MButton::send {LButton Up}!{right}
~MButton & LButton::send {MButton Up}!{left} |
|
| Back to top |
|
 |
helpme
Joined: 22 Apr 2007 Posts: 33
|
Posted: Tue Jun 10, 2008 2:15 am Post subject: |
|
|
I think I have found one way to get rid of the context windows.
Try the following;
| Code: |
~RButton & LButton::
{
;send {RButton Up}!{left}
SendInput !{Right} ;Alt-right (browse forward)
Sleep 200 ;delay 200ms
SendInput {Escape}
return
}
|
The code will send the {Escape} key to remove the context window after waiting for 200ms.
I am feeling rather guilty as I have only been asking questions and benefiting from the Gurus here like a parasite without making useful contributions to this forum.
Hope this post will be of use to fellow AutoHotkey users. |
|
| Back to top |
|
 |
chrisb24 Guest
|
Posted: Sat Jun 06, 2009 4:30 pm Post subject: |
|
|
Heres the code to make forward and back not interfering with Firefox mouse gesture for same buttons stroke
| Code: | ~RButton & ~LButton::
IfWinActive, ahk_class CabinetWClass
{
;send {RButton Up}!{left}
SendInput !{Left} ;Alt-right (browse forward)
Sleep 200 ;delay 200ms
SendInput {Escape}
return
}
return
~LButton & ~RButton::
IfWinActive, ahk_class CabinetWClass
{
;send {RButton Up}!{left}
SendInput !{Right} ;Alt-right (browse forward)
Sleep 200 ;delay 200ms
SendInput {Escape}
return
}
Return |
|
|
| Back to top |
|
 |
|