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 

Middle mouse button functionality lost

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



Joined: 05 Jul 2007
Posts: 4

PostPosted: Thu Jul 05, 2007 3:44 am    Post subject: Middle mouse button functionality lost Reply with quote

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



Joined: 24 Aug 2005
Posts: 345
Location: Berlin / Germany

PostPosted: Thu Jul 05, 2007 7:18 am    Post subject: Reply with quote

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



Joined: 05 Jul 2007
Posts: 4

PostPosted: Sun Jul 08, 2007 12:43 am    Post subject: Reply with quote

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



Joined: 06 Jun 2006
Posts: 1158
Location: Denmark

PostPosted: Sun Jul 08, 2007 8:55 am    Post subject: Reply with quote

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



Joined: 23 Jun 2007
Posts: 87

PostPosted: Sun Jul 08, 2007 9:52 am    Post subject: Reply with quote

Hi,
try this too:
Code:

~MButton & WheelUp::   Send, {HOME}

~MButton & WheelDown::   Send, {END}

the reason is written here

Bye! Shocked Smile
Back to top
View user's profile Send private message
mai9



Joined: 18 Mar 2008
Posts: 26
Location: Barcelona, Catalonia

PostPosted: Sun Jul 27, 2008 3:06 pm    Post subject: Reply with quote

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



Joined: 18 Mar 2008
Posts: 26
Location: Barcelona, Catalonia

PostPosted: Sun Jul 27, 2008 4:11 pm    Post subject: Reply with quote

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