| View previous topic :: View next topic |
| Author |
Message |
jedikalimero
Joined: 05 Jul 2007 Posts: 4
|
Posted: Thu Jul 05, 2007 3:44 am Post subject: Middle mouse button functionality lost |
|
|
I thinked it would be a good idea to reach the top and bottom of long pages (mainly in Firefox and IExplorer) using MButton combined with WheelUP/WheelDown and sending a Home or End keystroke to reach the top/bottom of the page.
So I added the following lines:
| Code: | MButton & WheelUp:: Send, {HOME}
MButton & WheelDown:: Send, {END}
|
But the problem is now a simple Middle Button stroke doesn't work anymore (in case I want to use the middle button in a program that makes good use of it like eMule)
It seems as if the new lines I added are absorbing the Mbutton events even if they are not accompanied by Wheel movements.
I also have the following comands in my scrip that maybe also have something to do with the problem:
| Code: | | XButton1 & MButton:: Send, +!{Tab} |
Also, instead of a Home or End it would be better to send the scrollbar to the top or bottom but I have no idea how to do this. |
|
| Back to top |
|
 |
nick
Joined: 24 Aug 2005 Posts: 345 Location: Berlin / Germany
|
Posted: Thu Jul 05, 2007 7:18 am Post subject: |
|
|
| AHK Manual wrote: | You can define a custom combination of two keys (except joystick buttons) by using " & " between them. In the below example, you would hold down Numpad0 then press the second key to trigger the hotkey:
Numpad0 & Numpad1::MsgBox You pressed Numpad1 while holding down Numpad0.
Numpad0 & Numpad2::Run Notepad
In the above example, Numpad0 becomes a prefix key; but this also causes Numpad0 to lose its original/native function when it is pressed by itself. To avoid this, a script may configure Numpad0 to perform a new action such as one of the following:
Numpad0::WinMaximize A ; Maximize the active/foreground window.
Numpad0::Send {Numpad0} ; Make the release of Numpad0 produce a Numpad0 keystroke. See comment below.
The presence of one of the above hotkeys causes the release of Numpad0 to perform the indicated action, but only if you did not press any other keys while Numpad0 was being held down. |
_________________ nick
denick @ http://de.autohotkey.com/forum/ |
|
| Back to top |
|
 |
jedikalimero
Joined: 05 Jul 2007 Posts: 4
|
Posted: Sun Jul 08, 2007 12:43 am Post subject: |
|
|
| nick wrote: | | AHK Manual wrote: | You can define a custom combination of two keys (except joystick buttons) by using " & " between them. In the below example, you would hold down Numpad0 then press the second key to trigger the hotkey:
Numpad0 & Numpad1::MsgBox You pressed Numpad1 while holding down Numpad0.
Numpad0 & Numpad2::Run Notepad
In the above example, Numpad0 becomes a prefix key; but this also causes Numpad0 to lose its original/native function when it is pressed by itself. To avoid this, a script may configure Numpad0 to perform a new action such as one of the following:
Numpad0::WinMaximize A ; Maximize the active/foreground window.
Numpad0::Send {Numpad0} ; Make the release of Numpad0 produce a Numpad0 keystroke. See comment below.
The presence of one of the above hotkeys causes the release of Numpad0 to perform the indicated action, but only if you did not press any other keys while Numpad0 was being held down. |
|
I already suspected this, so I added the last line of code:
| Code: | MButton & WheelUp:: Send, {HOME}
MButton & WheelDown:: Send, {END}
MButton:: MouseClick, Middle |
But this doesn't work. If in Notepad, When I click Middle button, nothing happens but if you then rotate the wheel, the cursor goes to the end or start of the line, so the first and second actions get executed even with the middle button not pressed. If you click the Middle button a second time, then the wheel perform as expected. It seems this action I added clicks the button but keeps it clicked the first time and releases it the second time.
In Notepad, when Middle button is clicked, the cursor should become a circle with two or four arrows and moving the mouse should move the scrollbars, since this is the default behavior of a mouse middle button in Windows.
PD: Also tryed with:
| Code: | MButton & WheelUp:: Send, {HOME}
MButton & WheelDown:: Send, {END}
MButton:: Send {MButton} |
With identical results |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1158 Location: Denmark
|
Posted: Sun Jul 08, 2007 8:55 am Post subject: |
|
|
Use the $ prefix for MButton (tested with RButton):
| Code: | $MButton:: Send {MButton}
MButton & WheelUp:: Send, {HOME}
MButton & WheelDown:: Send, {END}
|
_________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
Tarch
Joined: 23 Jun 2007 Posts: 87
|
Posted: Sun Jul 08, 2007 9:52 am Post subject: |
|
|
Hi,
try this too:
| Code: |
~MButton & WheelUp:: Send, {HOME}
~MButton & WheelDown:: Send, {END}
|
the reason is written here
Bye!  |
|
| Back to top |
|
 |
mai9
Joined: 18 Mar 2008 Posts: 26 Location: Barcelona, Catalonia
|
Posted: Sun Jul 27, 2008 3:06 pm Post subject: |
|
|
| tonne wrote: | | Code: | $MButton:: Send {MButton}
MButton & WheelUp:: Send, {HOME} |
|
| Tarch wrote: | | Code: |
~MButton & WheelUp:: Send, {HOME}
|
|
hi, what's the diference between these two? Which one should I write? |
|
| Back to top |
|
 |
mai9
Joined: 18 Mar 2008 Posts: 26 Location: Barcelona, Catalonia
|
Posted: Sun Jul 27, 2008 4:11 pm Post subject: |
|
|
ok, let me answer myself. The one without ~ makes the middle click activate when released, when the one with it sends the middle click when pressed. At least this is how it's working on another similar script I am working on.
Here's a similar problem I have with it:
| Code: |
k::Send {k}
k & h::Send {Left}
k & Space & h::Send +{Left} |
the third hotkey isn't even accepted by autohotkey.
I want to select text by pressing k+space and h. |
|
| Back to top |
|
 |
|