Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 07, 2016, 06:28:20 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Middle click without using scrollwheel button  (Read 9904 times)

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
IDEA: Middle click without using scrollwheel button
« on: July 02, 2008, 03:38:21 AM »
I have a problem with my computer and I don't know if it is my mouse, the P/S2 extension cord for it, or something else, nor do I care to test and replace the defective part, since it just isn't worth investing any money into this 11 year old 9x PC.

The scrollwheel isn't working properly. No matter what direction you scroll, it just jumps to bottom of page. Middle clicking does same thing, bottom of a page.

I can get around most of it with the keyboard, using that for scrolling instead of the wheel, but middle clicking isn't possible and that is the problem.

I am tired of right clicking, waiting for a menu to pop up (it's sooo slow), and selecting the option that does what a middle click would do.

Is there anything that could make a double click do what a middle click would normally do? If not, can someone make something that does?

It would also be good if I can activate/deactivate the utility with a hotkey or option on a tray menu so it won't conflict with anything that would require me to use a double click for a different purpose, such as a game.

Please, no .NET stuff, as this is a very old slow 9x machine with very little RAM.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 2,927
    • View Profile
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #1 on: July 02, 2008, 04:05:04 AM »
 I run PowerPro, and don't know if this is PowerPro-specific.  Under PowerPro, shift-left-click works as if it were middle-click.  That's what I've been doing for ages.

In fact, I've just this minute realised that the scrollwheel doubles as the apparently missing middle mouse button...   :-[


edit by jgpaiva: fixed powerpro link
edit2 by jgpaiva: really fixed the powerpro link.. Last time i replaced it by www.powerpro.com :-[ Sorry!
« Last Edit: July 02, 2008, 04:37:53 AM by jgpaiva »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #2 on: July 02, 2008, 04:06:36 AM »
How about an ahk script to replace ctrl + rightClick by middle mouse button?
Another option would be using double-rightclick, so you could leave it always enabled.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #3 on: July 02, 2008, 04:08:32 AM »
ooooh...I like the double right click idea.  :)

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #4 on: July 02, 2008, 04:21:50 AM »
I run PowerPro, and don't know if this is PowerPro-specific.  Under PowerPro, shift-left-click works as if it were middle-click.  That's what I've been doing for ages.

In fact, I've just this minute realised that the scrollwheel doubles as the apparently missing middle mouse button...   :-[


Shift-left click does almost the same thing as middle clicking, but in my browser that opens a link in a new tab, in the foreground rather than in the background like middle clicking would do.

And I really don't want to run a super-duper-multi-purpose tool to do this, as I have a slow CPU and very little RAM on this pc.

By the way, I couldn't reach that site with the link you provided, but this one did work: http://powerpro.webeddie.com/

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #5 on: July 02, 2008, 04:35:54 AM »
Quote from: ahk help file
The mouse hook monitors mouse clicks for the purpose of activating mouse hotkeys and facilitating hotstrings. It is not supported under Windows 95/98/Me because those operating systems require a different type of hook that must reside in a DLL file.
:(

Ok, but i tried anyways. Here's the code:
; Author:         jgpaiva
;
; Script Function: replace double-right click by middle click
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


rbutton::
keywait,rbutton,T0.1
if(errorlevel != 0){
Send,{rbutton down}
keywait,rbutton
Send,{rbutton up}
return
}
keywait,rbutton,D T0.1
if(errorlevel = 0)
Send,{mbutton}
else
Send,{rbutton}
return

f11::exitapp

I recommend you keep that last line, so that you can close the script by pressing F11, in case it goes wrong (and takes your right-click away). It should work well (at least, it does here).
To modify the timeout for the double-click, change the "0.1" to something larger or smaller.

ps: This is actually fun to play with! :D

[edit] removed a debug tooltip [/edit]

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #6 on: July 02, 2008, 05:06:48 AM »
Doesn't seem to work at all here. No effect, good, bad, or otherwise. :(


Quote from: ahk help file
The mouse hook monitors mouse clicks for the purpose of activating mouse hotkeys and facilitating hotstrings. It is not supported under Windows 95/98/Me because those operating systems require a different type of hook that must reside in a DLL file.

That's why I didn't do this myself in Delphi. I haven't had that much luck coding keyboard/mouse hooks because I can't seem to wrap my head around the whole .dll thing to make it work.

Edit: Typonese to English translation  :-[
« Last Edit: July 02, 2008, 05:09:20 AM by app103 »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #7 on: July 02, 2008, 05:22:44 AM »
if you don't mind using your keyboard, then you can try Numpad Mouse or Mouse Emulator. both programs can 'simulate' middle-clicks from the keyboard.

Source: http://www.donationc...ex.php?topic=12078.0

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #8 on: July 02, 2008, 06:19:19 AM »
Nevermind about this coding snack. I discovered I really don't need it, after all.

Shift+left click wasn't what I wanted since it opened the tab in the foreground but...

Ctrl+left click opens it in the background, like I wanted, like a middle click would do.

Not being a keyboard freak, I really don't know this stuff. I thought ctrl+left click was for over-riding the popup blocker when a link wants to open in a new window and the popup blocker wants to prevent it from opening at all.  :-[

Oh well...at least 2 of us learned something in the process: I learned about what ctrl+left click really does, rjbull and found his "missing" middle mouse button.  :D

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #9 on: July 02, 2008, 06:25:29 AM »
In fact, I've just this minute realised that the scrollwheel doubles as the apparently missing middle mouse button...

@rjbull: if you had stayed "un-realised" then you'd endeared yourself to many in this thread. ;D

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 2,927
    • View Profile
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #10 on: July 02, 2008, 08:55:03 AM »
And I really don't want to run a super-duper-multi-purpose tool to do this, as I have a slow CPU and very little RAM on this pc.

By the way, I couldn't reach that site with the link you provided, but this one did work: http://powerpro.webeddie.com/

Glad you found Ctrl-LeftClick worked!

The link is working now...  PowerPro is a relatively resource-light application especially for all it does, but it rather becomes a way of life.  You could try some of the other macro programs instead, of course.  At least some of them should work on Win9x.  E.g. Macro Maker, which is dated 2003.


rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 2,927
    • View Profile
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #11 on: July 02, 2008, 08:58:31 AM »
In fact, I've just this minute realised that the scrollwheel doubles as the apparently missing middle mouse button...

@rjbull: if you had stayed "un-realised" then you'd endeared yourself to many in this thread. ;D

I never said I like it that way!   :D

cheesemoo

  • Participant
  • Joined in 2008
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #12 on: October 02, 2008, 10:20:55 PM »
For anyone interested, I threw some AHK code together that lets you click your left & right buttons at the same time to get a middle click. This code avoids the problems caused by using the following simple AHK script that sends a middle click whenever the two buttons are held down at once:

~LButton & RButton::MouseClick, Middle
~RButton & LButton::MouseClick, Middle

For example, using my code, you can still hold down the left button and click the right one to jump forward one page in Opera (or whatever). It also keeps the middle mouse button held in until you release one of the two buttons, so for some program that uses middle-click dragging, you should also be able to use this (though I haven't tested that, I don't think I have any program that makes use of a middle-drag).

There are some additional hotkeys included: windows+m toggles the middle-click behavior on and off (if some program refuses to work with it on, this will return your mouse to normal functionality and let you switch back when done). F11 quits the script altogether, and F12 reloads the script from the HD. You'll probably want to leave those last two out at least since they were just for debugging.

You can also adjust how fast you have to be in hitting both at once. The default value which worked well for me was 20ms. Lower values will make it harder to trigger a middle click, but higher values will add more delay to your clicking. That is, if you are just trying to do a left click for example, the program will wait 20ms to see if you're also going to click the right button. After that time has passed without a right click, it will send the left click that you wanted.

I'm not sure that there's any way around adding a delay to make this work, since the program must have some wiggle room for you to click both buttons, but cannot send a click until it knows what you wanted to send. It's not like it can send a left click, then when your right click comes in 10ms later, cancel the left click and send a middle click.

Anyway, a 20ms delay is unnoticeable for me when I'm using my laptop's trackpad, and well worth being able to both have a middle-click and do proper forward/backward gestures in Opera.

Give this a try, let me know what you guys think. I'm sure it could have been coded more elegantly - I threw this together when it seemed that nothing else would do what I wanted to do, and this is the first version that I was happy with.

Edit: to give credit where it is due, this code started out as a copy-paste of one of the AHK example code snippets for the SetTimer function. I also used jgpaiva's code above as a starting point on how to use AHK's mouse functions.

« Last Edit: October 02, 2008, 10:23:52 PM by cheesemoo »

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: IDEA: Middle click without using scrollwheel button
« Reply #13 on: October 03, 2008, 09:13:40 AM »
Well, since it still involves the same mouse related stuff that isn't supported on 9x and I'll be on this 9x machine for only about 2 more weeks, I'll pass on testing it.

One thing I would like to mention about your choice of hotkey to toggle on/off...Windows+M is used to minimize all windows, by default.